关于jsp页面使用jstl的异常分析
程序员文章站
2023-10-20 13:45:14
1.在jsp页面中使用如下代码加入jstl的支持 复制代码 代码如下: <%@ taglib prefix="c" uri="http://java.sun.com/...
1.在jsp页面中使用如下代码加入jstl的支持
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
2.如果jsp页面报如下异常
org.apache.jasper.jasperexception: java.lang.classnotfoundexception: org.apache.jsp.customer.addcustomerinfo_jsp
org.apache.jasper.servlet.jspservletwrapper.getservlet(jspservletwrapper.java:177)
org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:369)
org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:390)
org.apache.jasper.servlet.jspservlet.service(jspservlet.java:334)
javax.servlet.http.httpservlet.service(httpservlet.java:722)
org.springframework.orm.hibernate3.support.opensessioninviewfilter.dofilterinternal(opensessioninviewfilter.java:198)
org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:76)
org.springframework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:96)
org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:76)
root cause
java.lang.classnotfoundexception: org.apache.jsp.customer.addcustomerinfo_jsp
java.net.urlclassloader$1.run(urlclassloader.java:200)
java.security.accesscontroller.doprivileged(native method)
java.net.urlclassloader.findclass(urlclassloader.java:188)
org.apache.jasper.servlet.jasperloader.loadclass(jasperloader.java:132)
org.apache.jasper.servlet.jasperloader.loadclass(jasperloader.java:63)
org.apache.jasper.servlet.jspservletwrapper.getservlet(jspservletwrapper.java:172)
org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:369)
org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:390)
org.apache.jasper.servlet.jspservlet.service(jspservlet.java:334)
javax.servlet.http.httpservlet.service(httpservlet.java:722)
org.springframework.orm.hibernate3.support.opensessioninviewfilter.dofilterinternal(opensessioninviewfilter.java:198)
org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:76)
org.springfr
amework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:96)
org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:76)
那么很有可能是你的tomcat的lib目录中没有jstl的jar包,所以才导致tomcat无法解析jstl
解决方案:在tomcat的lib目录中添加jstl的jar包即可。
jstljar包下载地址:
复制代码 代码如下:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
2.如果jsp页面报如下异常
org.apache.jasper.jasperexception: java.lang.classnotfoundexception: org.apache.jsp.customer.addcustomerinfo_jsp
org.apache.jasper.servlet.jspservletwrapper.getservlet(jspservletwrapper.java:177)
org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:369)
org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:390)
org.apache.jasper.servlet.jspservlet.service(jspservlet.java:334)
javax.servlet.http.httpservlet.service(httpservlet.java:722)
org.springframework.orm.hibernate3.support.opensessioninviewfilter.dofilterinternal(opensessioninviewfilter.java:198)
org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:76)
org.springframework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:96)
org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:76)
root cause
java.lang.classnotfoundexception: org.apache.jsp.customer.addcustomerinfo_jsp
java.net.urlclassloader$1.run(urlclassloader.java:200)
java.security.accesscontroller.doprivileged(native method)
java.net.urlclassloader.findclass(urlclassloader.java:188)
org.apache.jasper.servlet.jasperloader.loadclass(jasperloader.java:132)
org.apache.jasper.servlet.jasperloader.loadclass(jasperloader.java:63)
org.apache.jasper.servlet.jspservletwrapper.getservlet(jspservletwrapper.java:172)
org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:369)
org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:390)
org.apache.jasper.servlet.jspservlet.service(jspservlet.java:334)
javax.servlet.http.httpservlet.service(httpservlet.java:722)
org.springframework.orm.hibernate3.support.opensessioninviewfilter.dofilterinternal(opensessioninviewfilter.java:198)
org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:76)
org.springfr
amework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:96)
org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:76)
那么很有可能是你的tomcat的lib目录中没有jstl的jar包,所以才导致tomcat无法解析jstl
解决方案:在tomcat的lib目录中添加jstl的jar包即可。
jstljar包下载地址: