Spring MVC报错:java.lang.NullPointerException at org.apache.jsp.WEB_002dINF.jsp.index_jsp._jspInit(index_jsp.java:31)
报错:访问Maven
管理的SpringMVC
项目jsp
页面,错误:at org.apache.jsp.WEB_002dINF.jsp.index_jsp._jspInit(index_jsp.java:31)
原因:是项目的servlet-api
或jsp-api
两个jar
包与Tomcat
自带的包冲突导致。
解决:在pom.xml
文件,将这两个jar
包添加<scope>provided</scope>
控制,只在编译和测试有效。
Spring MVC报错:java.lang.NullPointerException at org.apache.jsp.WEB_002dINF.jsp.index_jsp._jspInit(index_jsp.java:31)
http://blog.gxitsky.com/2018/02/23/SpringMVC-exception-jsp-init-NullPointException/