Don’t panic in case of data tilt, teach you to easily obtain the slope of table tilt>>>
We often copy other people’s projects to ourselves for secondary development or reference. Sometimes the above error occurs, that is, in the eclipse project, our imported project prompts that HttpServletRequest can’t be referenced, which will be accompanied by a headache Red Cross
The specific reason is that the corresponding package package package javax.servlet.http is missing in the web inf/lib directory of our project
The jar package supporting servlets is called servlet-api.jar
If you have ever written a servlet, you know that you need to use objects such as HttpServletRequest and httpservletresponse. These objects can only be used by this jar package
Generally speaking, lacks Tomcat_ Servlet API. Jar under home/lib
I import other people’s projects. He configures the server on other people’s machines, which is usually Tomcat. In the process of copying, those libraries of the server will not be copied with the project, unless someone else has copied Tomcat’s library to WEB-INF/lib
Possible 1 solution: select the local servlet-api.jar into the project
Possible 2 solutions:
Similar Posts:
- import javax.servlet.http.HttpSession;
- HTTP Status 500 – Unable to compile class for JSP settlement program
- Tomcat10 Error: java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
- Tomcat Startup Error: Server Tomcat v8.5 Server at localhost failed to start.
- [Solved] IDEA: JSP Could Not Use session Build-in Object
- Using Tomcat 10 to build a servlet, an error is reported: class XXX is not a servlet
- Error 500: javax. Servlet. ServletException: srve0207e: uncaught initialization
- [Solved] Spring Error: Artifact spring:war exploded: Error during artifact deployment. See server log for details
- Tomcat Deployed Applications Start Error: java.lang.ClassCastException: [XXX].filter.CharacterEncoding cannot be cast to jakarta.servlet.Filter
- Error in importing servlet project from eclipse