The solution to javax.servlet does not exist
When using HttpServlet with eclipse, it prompts the error that javax.servlet does not exist.
At this time, because of the lack of javax.servlet related class libraries in the dependent libraries of the project.
Download javax.servlet
Servlet related class packages are included in Tomcat, we can download Tomcat to get.
For example, the class library location is: apache-tomcat-7.0.107/lib/servlet-api.jar
Solution 1: Add the class library to the jre extension directory
Copy servlet-api.jar to the "JDK\jre\lib\ext" directory and recompile it.
Solution 2: Add project dependencies
- Select the project, right click, and select Build Path:
- Just add the corresponding jar package:
PS: For more more content..., please check --> "Server Development"
PS: More more content..., please check --> "Server Development"
PS: More more content..., please check --> "Server Development"