Eclipse, and several questions about Tomcat

Source: Internet
Author: User

Http://blog.sina.com.cn/s/blog_56b0cb2d01000a7r.html Eclipse, and Tomcat has several issues.


1, the project does not compile the problem. Sometimes, the project will be dead or alive without compiling the situation. There are several reasons for this.

First: See if the Java Build path has an error message in the project's properties. If the error is given here, it must be the main reason for the compilation.

Second: the Userlib (user package) referenced by the project does not exist. Because the CVS shared the project. The initiator of the project has built its own LIB package variable locally, while the other user has been down from CVS because there is no corresponding LIB variable locally. The system does not compile correctly. It is not recommended to use variables. To facilitate other users.

Third: If the reason is not found, use the Clean command directly under the project directory, which will empty all compiled files and recompile all files.

Four: It's still not working, just close eclipse and reboot.

Five: Not yet, just look for me.

2, the version:3.1.0 version of Eclipse, "alt+/" in the original 3.0 version of the Help shortcut keys to the new edition became Ctrl+space. Conflict with our input method.

Modification: Menu window->perferecens->general->key->view page Find cotent Assist line, click on the above modify. To modify the page, the shortcut keys are deleted. Then use the BACKSPACE key in the following name to delete the ctrl–space. Then press ALT +/. Then select from the when below, then add.



3, control enables eclipse to open the file with the specified editor. Because of a strange file, Eclipse always does not automatically recognize the last way it was opened. Set method to

Window->perferecens->general->editors This page has several hyperlinks on File associations. Click on him to set it up.

4, eclipse3.0. In the properties of the file, after you modify the encoding format of the file. The system does not re-open the file in the encoding format you specified. This bug has been resolved in 3.1. And 3.1 of the items in the search (selected items, click on the menu search->search or ctrl+h) is also much faster. It's easier to use.

5, about file format. The file's open encoding format is set by Eclipse's total window->perferecens->general->editors. This encoding format is used by default. If there is a special encoding format in the file attributes can be set separately.



6, there is no question about the CSS file that works. If the encoding format of the page is inconsistent with the encoding format of the CSS. CSS will fail. If the page is in Utf-8 format, then you must ensure that the CSS format is also utf-8. JavaScript files are the same



7, for JavaScript files, there must be no illegal invisible characters. Otherwise the page will report a script error. In the script file it is best not to have Chinese comments, if must have, it is best to have two carriage return below the comment, and then write the code. This guarantees that there will be no problem.



8, JSP compilation problem. When you access a JSP through a URL, Tomcat does the following:

First, the detection of this JSP

Then, the detection of the/app/jakarta-tomcat-5.5.9/work/catalina/www.uland.com/_/org/apache/jsp directory there is no corresponding to the JSP translated Java files and class files

Then, if it does not exist, compile the JSP file into that directory.

If it already exists, detects if the last updated date of the current JSP is newer than the existing Java file.

If the existing Java file is new, the system discards the compilation and reads the Java class file directly.

If the existing Java file is older than the current JSP file, Tomcat will recompile the JSP.

If the compilation succeeds, replace the old Java file with the new Java file. and show the new page effect

If the compilation fails, the foreground will display the wrong page alternately 1:3 times with the page that already exists. It displays 1 error pages, followed by 3 visits, showing the correct class files that already exist. Tomcat has his reasons for doing the same. Ensure the system to the user's effect.



Problem: When we drag and drop JSP files from our local to remote server, if there is no effect update. One option is to empty the work directory. It's more thorough, but it's clear every time. Then there is the date of the remote system is not earlier than the date of the eclipse system we are currently using. If so, update the date over there a little bit slower than ours. Sometimes the page prompt error line is always the number of the compiled Java file line, then you can directly to the Java file location error. Very convenient.



9, a few questions to note in Tomcat's server.xml:

First: <connector port= "redirectport=" 8443 "maxkeepaliverequests="-1 "minsparethreads=" "connectiontimeout=" 20000 "maxsparethreads=" "acceptcount=", "maxthreads=", maxhttpheadersize= "8192" uriencoding= GBK Inside the uriencoding= "GBK" Directly controls the file encoding format in the URL. Tomcat is to decode the parameters in this parameter pair. If you do not write the default use of the encoding is iso-8859-1, if using UTF8 best. More general.

Second: <context path= "" docbase= "." debug= "0" crosscontext= "true" allowlinking= "true" reloadable= "true"/> The reloadable parameter is set to True, and if a change is made to the identity class, Tomcat will automatically restart the site. allowlinking= allowlinking= "True" identifies a virtual directory that allows this app to use Linux. Otherwise, the set virtual directory does not take effect.

Eclipse shortcut key ctrl+q is useful for locating to the last edit location.


11, add:
When eclipse edits Java files, if the characters inside are garbled, the file format is not in GBK format. Because the eclipse default edits the file using this format. Modify the Open file format of Eclipse according to the format of the file.

Windows-> Perfrence->general->editor. Modify the GBK on this page-〉 the other UTF-8.

Eclipse, and several questions about Tomcat

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.