JSP编译错误对于IBM JDK 1.5 Servlet版本2.5
我正在使用 IBM JDK 和 Eclipse Hellos。当我开发简单的 Web 项目时,我在编译 jsp 页面时遇到错误。如果我将 JDK 更改为普通的 Sun JDK,那么一切都会正常工作。但我必须使用IBM jdk作为生产环境;我必须使用网络领域。
我收到的错误是这样的:
org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 22 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:439) org.apache.jasper.compiler.Compiler.compile(Compiler.java:334) org.apache.jasper.compiler.Compiler.compile(Compiler.java:312) org.apache.jasper.compiler.Compiler.compile(Compiler.java:299) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
谁能告诉我我必须做什么?
I'm using IBM JDK and Eclipse Hellos. When I'm devloping simple web project, I'm getting error in compilation of jsp page. If I change my JDK to normal Sun JDK, then every thing's working fine. But I have to use IBM jdk as production environment; I have to use web sphere.
The error I'm getting is this:
org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 22 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:439) org.apache.jasper.compiler.Compiler.compile(Compiler.java:334) org.apache.jasper.compiler.Compiler.compile(Compiler.java:312) org.apache.jasper.compiler.Compiler.compile(Compiler.java:299) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
Can anyone tell me what I have to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
方法
getJspApplicationContext(ServletContext)
未定义类型JspFactory
- 这意味着类路径上的JspFactory
没有所需的方法。该方法自 servlet api 2.1 版本起可用,因此请确保WEB-INF/lib
中没有任何 servlet-api、jsp-api 或 el-api,并且您的 WebSphere支持Servlet 2.1。The method
getJspApplicationContext(ServletContext)
is undefined for the typeJspFactory
- this means thatJspFactory
on the classpath does not have the desired method. The method is available since version 2.1 of the servlet api, so make sure you don't have any servlet-api, jsp-api or el-api inWEB-INF/lib
, and that your WebSphere supports Servlet 2.1.