java.lang.NullPointerException at org.apache.jsp.***_jsp._jspInit(***_jsp.java:22)

错误原因:在你的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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值