错误原因:在你的webapp的/WEB-INF/lib目录下有jsp-api.jar、servlet-api.jar、el-api.jar等这样的特定的库。
解决办法:知道错误原因,当然解决办法就非常简单了,就是移除这些jar包。
当然移除jar包后,在jsp页面中有人可能会出现这样的错误:javax.servlet.jsp.JspException cannot be resolved to a type,或者说就是因为报这样的错所以添加了上面那些特定的jar包;
解决办法:
右键项目 > properties > Targeted Runtimes > 选择一个web服务器 > ok
两种解决办法的英文回答,英文回答来自:http://stackoverflow.com/
To fix this, you need to ensure that you do not have any servletcontainer specific libraries such as jsp-api.jar, servlet-api.jar, el-api.jar, etc in your webapp’s /WEB-INF/lib and for sure not in JRE’s JRE/lib and JRE/lib/ext.
I guess this may work, in Eclipse select your project → then click on project menu bar on top → goto to properties → click on Targeted Runtimes → now you must select a check box next to the server you are using to run current project → click Apply → then click OK button. That’s it, give a try.
java.lang.NullPointerException at org.apache.jsp.***_jsp._jspInit(***_jsp.java:22)
最新推荐文章于 2023-06-23 18:33:03 发布