Errors related to eclipse web project import.
1. JavaWeb: error message The superclass "javax. servlet. http. HttpServlet" was not found on the Java Build Path
Solution: Right-click the web Project-> property or Build Path-> Java Build Path-> Libraries-> Add Libray...-> Server Runtime-> Tomcat Server
Switch to Orader and Export on the Java Build Path interface and select Tomcat.
If a blank page is displayed after the Server Runtime is enabled, you need to set the Apache Server. The setting method is window-> Preferences-> Server-> Runtime Environment-> add --> select the Apache version, click Next, and then fill in the installation of your apache Server software (after decompression) address.
2. garbled Chinese characters are displayed after the import.
Before importing the project, make sure that the workspace encoding is set to UTF-8: window-> Preferences-> General-> Wrokspace-> Text file encoding-> Other select UTF-8
3. After the import, the Build Path error may occur because the JRE and Tomcat Library names in your development environment may be inconsistent with those in the source code.
The solution is as follows: right-click project-> Build Path-> Configure Build Path-> choose Libraries tab-> Delete Library with a small Red Cross-> click Add Library-> select JRE System Library (delete Tomcat select Server Runtime if the Library is used) -> select a JRE and click-> Finish.
4. Different Tomcat versions
Go to. settings directory, find org. eclipse. wst. common. project. facet. core. xml file. It is found that this sentence has a problem only after it is opened in Notepad: runtime name = "Apache Tomcat v6.0"/. In eclipse, tomcat is set to version 7.0, and its running environment is tomcat of version 6.0. So I deleted this sentence. It is normal.
It is recommended that you restart eclipse after completing the above operations. Sometimes, after the changes are completed, you must restart to take effect.