The project under eclipse cannot find the package in the javaee library

A previously created project always reported an error when opening it.
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


Later, I remembered that this project was released under tomcat7.0, 
That is to say, "add library->Server runtime under the buildpath of this project was tomcat7.0,
And now the server runtime I add to this project is tomcat 6.0 (or no tomcat is added),

So there will be such an error, when I change the server runtime to tomcat 7.0, there is no error.


Summary: In the web project under eclipse, the packages under his javax.servlet all need to apply the libraries under tomcat, so once the location of tomcat changes and other reasons, the package cannot be found.

Guess you like

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