在struts1.3.8中自定义的标签的标签不能被解析到

J2EE 码拜 10年前 (2015-04-03) 971次浏览 0个评论
 

雪地跪求各位大神帮忙看一下!

1. 原来的项目是在javaSE1.4下编译,部署在tomcat5中,现在把原项目拷贝的javaSE1.7下编译,部署在tomcat7中。

2. 在struts1.3.8中自定义的标签的标签不能被解析到,标签定义如下:

<?xml version=”1.0″ encoding=”UTF-8″ ?>
<taglib xmlns=”http://java.sun.com/xml/ns/j2ee”
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
    xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd”
    version=”2.0″>
    
  <description>itcast babasport permission taglib</description>
  <display-name>permission taglib</display-name>
  <tlib-version>1.0</tlib-version>
  <short-name>itcast</short-name>
  <uri>http://www.itcast.cn/babasport</uri>

  <tag>
    <description>权限校验标签,有权限就显示标签体的内容,否则不显示</description>
    <name>permission</name>
    <tag-class>cn.itcast.web.taglib.PermissionTag</tag-class>
    <body-content>JSP</body-content>
    <attribute>
        <description></description>
        <name>module</name>
        <required>true</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <description></description>
        <name>privilege</name>
        <required>true</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
  </tag>  
</taglib>

3. 运行结果如下所示:

SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /WEB-INF/page/product/frontpage/productlist.jsp (line: 2, column: 0) The absolute uri: http://www.itcast.cn/babasport cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:89)
at org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:324)
at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:357)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:467)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1427)
at org.apache.jasper.compiler.Parser.parse(Parser.java:138)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1078)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:396)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:232)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:746)
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:716)

在struts1.3.8中自定义的标签的标签不能被解析到
20分
自定义标签要在web.xml中注册一下  ,1.3.8版本要注册 ,我用的也是1.3.8的版本 
在struts1.3.8中自定义的标签的标签不能被解析到
之前没有在web.xml中注册是没问题的,当我在web.xml中注册时反而出现了错误,我认为应该是环境的原因。

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明在struts1.3.8中自定义的标签的标签不能被解析到
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!