【JSP报错】—— org.apache.jasper.JasperException: Unable to compile class for JSP

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: [52] in the generated java file: [D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\logTest\org\apache\jsp\index_jsp.java]
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:198)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:580)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

跟踪java代码发现:

【JSP报错】—— org.apache.jasper.JasperException: Unable to compile class for JSP

原因是由于我在Maven中引入了servlet的jar包,又在工程中引入了tomcat的所有Jar包,导致冲突。

上一篇:【技术分享】使用CTS进行漏洞检测及原理浅析


下一篇:scrapy 简单爬虫实验