日期:2014-05-16  浏览次数:20327 次

tomcat 不能编译所以的jsp
每次访问jsp页面都出现下面异常;

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
//所有jsp都不能编译,不能显示;;;
//包冲突
//jsp 工作  servlet-api.jar jsp-api.jar  [类库,jar包]
//tomcat servlet-api.jar   -> myeclipse j2eeservlet-api.jar
解决方案:
1:在myeclipse部署后,打开tomcat 的lib  去掉 servlet-api.jar   javax.servlet.jsp.jar

2:写命令来删除,在当前项目下写个del.bat文件,然后项目部署后就点击一下这个命令;
del.bat
del F:\apache-tomcat-6.0.29-windows-x86\apache-tomcat-6.0.29\webapps\mail\WEB-INF\lib\javax.servlet.jar
del F:\apache-tomcat-6.0.29-windows-x86\apache-tomcat-6.0.29\webapps\mail\WEB-INF\lib\javax.servlet.jsp.jar
我的异常网推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.aiyiweb.com/j2ee/2308.html