Tomcat 5.0.28下有STRUTS标签的页面报错,虚心请教高手!
查Tomcat 5.0.28的日志信息如下:
2007-04-30 12:38:19 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.ClassNotFoundException: org.apache.struts.taglib.html.MessagesTei
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
在Tomcat 5.0.28下发出请求http://localhost:8888/ksxtWeb/后控制台报错信息如下:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.html.MessagesTei
root cause
java.lang.
ClassNotFoundException: org.apache.struts.taglib.html.MessagesTei
我已在webapps\ksxtWeb\WEB-INF\lib下加入了struts.jar,nested_tags.jar等文件后还是不行,我采用的是STRUTS 1.0,请教高手如何解决?
------解决方案--------------------会不会是这个 "/ "的问题啊?用相对路径行不行?
------解决方案--------------------我发现在JSP页面上一加入如下代码就报错:(在IDE里调试JSP页面也是这种情况)
<%@ taglib uri= "/WEB-INF/struts-bean.tld " prefix= "bean " %>
<%@ taglib uri= "/WEB-INF/struts-html.tld " prefix= "html " %>
<%@ taglib uri= "/WEB-INF/struts-logic.tld " prefix= "logic " %>
<%@ taglib uri= "/WEB-INF/struts-nested.tld " prefix= "nested " %>
这个的原因是你没有在配置文件里定义这些标签文件的位置
改一下你的web.xml文件,添加如下代码:
<jsp-config>
<taglib>
<taglib-uri> /tags/struts-bean </taglib-uri>
<taglib-location> /WEB-INF/struts-bean.tld </taglib-location>
</taglib>
<taglib>
<taglib-uri> /tags/struts-html </taglib-uri>
<taglib-location> /WEB-INF/struts-html.tld </taglib-location>
</taglib>
<taglib>
<taglib-uri> /tags/struts-logic </taglib-uri>
<taglib-location> /WEB-INF/struts-logic.tld </taglib-location>
</taglib>
<taglib>
<taglib-uri> /tags/struts-nested </taglib-uri>
<taglib-location> /WEB-INF/struts-nested.tld </taglib-location>
</taglib>
</jsp-config>
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.aiyiweb.com/java-web/317.html