Eclipse creates an error in the jsp header of a Maven web project

When using eclipse to create a project today, an error occurred in the header of the automatically created file, which is the default index.jsp page: superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path, and the jboss server has Install, then how to solve it?

  I tried a lot of methods, and some said that the corresponding dependent jar package was missing. After configuration, it still reported an error. Fortunately, I found the answer.

  It turned out that the established web project did not add the corresponding tomcat or jboss runtime related classes. Because the web project runs on the Tomcat or jboss server, generally when we build a web project, we will specify the Target runtime, which is the runtime version, in advance, so how to set it?

  (1) Right-click on the web project -----"Properties or Build Path------"Java BuildPath->Libraries------"AddLibray...------"Server Runtime


  (2) Click Next to enter the next step to select the server


  (3) Switch to Oraderand Export in the Java Build Path interface

  This may not be displayed clearly, for example, we create a dynamic java web project:


  The problem is finally solved, and the learning continues~

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325873084&siteId=291194637