The method getJspApplicationContext (ServletContext) is undefined for the type
Causes of JspFactory exceptions and solutions:
Is because of the Project WEB-INF/lib under the existence of jsp-api.jar, servlet-api.jar, and Tomcat built-in jar package conflict caused.
Solution:
Remove jsp-api.jar, servlet-api.jar in the web Project Lib directory and restart Tomcat service issue resolution.
When creating a project, both the jsp-api.jar and servlet-api.jar jar packages do not need to be manually added to the web project, which is included in Tomcat.
The exception information is as follows:
Org. apache. jasper. JasperException: Unable to compile class for JSP:
An error occurred at line: 23 in the generated java file
The method getJspApplicationContext (ServletContext) is undefined for the type JspFactory
Stacktrace:
Org. apache. jasper. compiler. DefaultErrorHandler. javacError (DefaultErrorHandler. java: 92)
Org. apache. jasper. compiler. ErrorDispatcher. javacError (ErrorDispatcher. java: 330)
Org. apache. jasper. compiler. JDTCompiler. generateClass (JDTCompiler. java: 423)
Org. apache. jasper. compiler. Compiler. Compiler (compiler. java: 308)
Org. apache. jasper. compiler. Compiler. Compiler (compiler. java: 286)
Org. apache. jasper. compiler. Compiler. Compiler (compiler. java: 273)
Org. apache. jasper. JspCompilationContext. compile (JspCompilationContext. java: 566)
Org. apache. jasper. servlet. JspServletWrapper. service (JspServletWrapper. java: 317)
Org. apache. jasper. servlet. JspServlet. serviceJspFile (JspServlet. java: 320)
Org. apache. jasper. servlet. JspServlet. service (JspServlet. java: 266)
Javax. servlet. http. HttpServlet. service (HttpServlet. java: 803) |
So the existing jar in Tomcat does not need to be included in the project during Tomcat deployment to avoid conflicts.