I haven't written Jsp for a long time. Today I created a Java Web project and configured Web container Tomcat in eclipse. I was happy to create a jsp page and add a simple Java class. However, The "red" error message appears at the top of The JSP page: the superclass "javax. servlet. http. HttpServlet" was not found on The Java Build Path. In the original Java web project, no Tomcat Runtime classes were added.
The specific solution is as follows:
1. Right-click the web Project-> property or Build Path-> Java Build Path-> Libraries-> Add Libray... -> Server Runtime-> Tomcat Server
2. Switch to Orader and Export on the Java Build Path interface and select Tomcat.
Note:
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