覆盖jar中的.tld文件

时间:2011-11-28 02:24:41

标签: java jsp java-ee jsp-tags tld

我已经为现有标签添加了一些新功能,并修改了相应的tld并将其放在WEB-INF /上。但有些tomcat没有选择这个修改过的.tld

我在这里做错了什么我需要把.tld文件覆盖在jar中的现有文件?  以下是例外

  org.apache.jasper.JasperException: Conversion.jsp(276,6) Attribute group invalid for tag column according to TLD
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:238)
at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:975)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:696)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:716)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
at org.apache.jasper.compiler.Validator.validate(Validator.java:1475)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:214)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)

2 个答案:

答案 0 :(得分:0)

您应该使用实现它的.class文件将.tld放在JAR中。

查看Apache JSTL standard.jar,了解如何正确执行此操作。

答案 1 :(得分:0)

可以通过指定标签的uri来覆盖.tld

  <%@ taglib uri="/WEB-INF/test.tld" prefix="testing" %>