当前位置: 代码迷 >> 综合 >> maven项目构建struts2框架项目遇到的org.apache.jasper.JasperException: Unable to compile class for JSP:
  详细解决方案

maven项目构建struts2框架项目遇到的org.apache.jasper.JasperException: Unable to compile class for JSP:

热度:34   发布时间:2023-12-08 12:59:00.0

创建maven工程时,并加入struts2框架,解析jsp页面的问题的时候,会出现如下异常

org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 1 in the generated java file
The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class filesAn error occurred at line: 22 in the generated java file
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

通过查询资料
有博友写的文章 标题 unable to compile class for JSP(不能编译class)

点击打开链接

文中提到结论:1、我的工程里的servlet.jar、jsp-servlet.jar的版本比较低与tomcat6.0相比。

                            2、tomcat的下面的lib里面不能与工程里面的jar相同(如果部署到tomcat上)。

                            3、把工程里面的两个jar包删除了,就解决了。

一直没有弄明白,直到查看了http

  相关解决方案