(1)在web.xml下加入自定义的标签如下:
  <taglib>
    <taglib-uri>/WEB-INF/app.tld</taglib-uri>
    <taglib-location>/WEB-INF/app.tld</taglib-location>
  </taglib>(2)在app.tld下的内容为:
   <tag>
    <name>showcat</name>
    <tagclass>tags.ShowcatTag</tagclass>
    <bodycontent>empty</bodycontent>
    <info>
        Displays the category tables from the database that match a given criteria
    </info>
   </tag>(3)ShowcatTag.java的内容为:
public final class ShowcatTag extends TagSupport { private Log log =
        LogFactory.getLog(this.getClass().getName());
public int doEndTag() throws JspException
{
JspWriter out = pageContext.getOut();
try
{
                   .......
                   }
         } public void release()
{
super.release();
}
}问题是当我重新启动Tomcat时,不停的出现以下的Log:
13:42:17,534 DEBUG sax:1004 - endElement(,,attribute)
13:42:17,534 DEBUG Digester:1007 -   match='taglib/tag/attribute'
13:42:17,534 DEBUG Digester:1008 -   bodyText=''
13:42:17,549 DEBUG Digester:1039 -   No rules found matching 'taglib/tag/attribute'.
13:42:17,549 DEBUG Digester:1046 -   Popping body text ''
13:42:17,549 DEBUG sax:1123 - ignorableWhitespace(
)
13:42:17,549 DEBUG sax:1234 - startElement(,,attribute)
13:42:17,549 DEBUG Digester:1241 -   Pushing body text ''
13:42:17,565 DEBUG Digester:1260 -   New match='taglib/tag/attribute'
13:42:17,581 DEBUG Digester:1284 -   No rules found matching 'taglib/tag/attribute'.
13:42:17,581 DEBUG sax:1123 - ignorableWhitespace(
)
13:42:17,581 DEBUG sax:1234 - startElement(,,name)
13:42:17,596 DEBUG Digester:1241 -   Pushing body text ''
13:42:17,596 DEBUG Digester:1260 -   New match='taglib/tag/attribute/name'
13:42:17,596 DEBUG Digester:1284 -   No rules found matching 'taglib/tag/attribute/name'.
13:42:17,596 DEBUG sax:936 - characters(scope)
13:42:17,596 DEBUG sax:1004 - endElement(,,name)
13:42:17,596 DEBUG Digester:1007 -   match='taglib/tag/attribute/name'
13:42:17,627 DEBUG Digester:1008 -   bodyText='scope'
13:42:17,627 DEBUG Digester:1039 -   No rules found matching 'taglib/tag/attribute/name'.
13:42:17,627 DEBUG Digester:1046 -   Popping body text ''
13:42:17,627 DEBUG sax:1123 - ignorableWhitespace(
)
13:42:17,643 DEBUG sax:1234 - startElement(,,required)
13:42:17,643 DEBUG Digester:1241 -   Pushing body text ''
13:42:17,643 DEBUG Digester:1260 -   New match='taglib/tag/attribute/required'
13:42:17,643 DEBUG Digester:1284 -   No rules found matching 'taglib/tag/attribute/required'.
13:42:17,643 DEBUG sax:936 - characters(false)
13:42:17,643 DEBUG sax:1004 - endElement(,,required)
13:42:17,674 DEBUG Digester:1007 -   match='taglib/tag/attribute/required'
13:42:17,674 DEBUG Digester:1008 -   bodyText='false'
13:42:17,674 DEBUG Digester:1039 -   No rules found matching 'taglib/tag/attribute/required'.
13:42:17,674 DEBUG Digester:1046 -   Popping body text ''
13:42:17,690 DEBUG sax:1123 - ignorableWhitespace(
)
13:42:17,690 DEBUG sax:1234 - startElement(,,rtexprvalue)
13:42:17,690 DEBUG Digester:1241 -   Pushing body text ''
13:42:17,690 DEBUG Digester:1260 -   New match='taglib/tag/attribute/rtexprvalue'
13:42:17,690 DEBUG Digester:1284 -   No rules found matching 'taglib/tag/attribute/rtexprvalue'.
13:42:17,721 DEBUG sax:936 - characters(true)
13:42:17,721 DEBUG sax:1004 - endElement(,,rtexprvalue)
13:42:17,721 DEBUG Digester:1007 -   match='taglib/tag/attribute/rtexprvalue'
13:42:17,721 DEBUG Digester:1008 -   bodyText='true'
13:42:17,721 DEBUG Digester:1039 -   No rules found matching 'taglib/tag/attribute/rtexprvalue'.
13:42:17,721 DEBUG Digester:1046 -   Popping body text ''
13:42:17,737 DEBUG sax:1123 - ignorableWhitespace(
)
13:42:17,737 DEBUG sax:1004 - endElement(,,attribute)
13:42:17,737 DEBUG Digester:1007 -   match='taglib/tag/attribute'
13:42:17,752 DEBUG Digester:1008 -   bodyText=''
13:42:17,768 DEBUG Digester:1039 -   No rules found matching 'taglib/tag/attribute'.
13:42:17,768 DEBUG Digester:1046 -   Popping body text ''
13:42:17,768 DEBUG sax:1123 - ignorableWhitespace(
)
13:42:17,768 DEBUG sax:1234 - startElement(,,attribute)
13:42:17,768 DEBUG Digester:1241 -   Pushing body text ''
13:42:17,784 DEBUG Digester:1260 -   New match='taglib/tag/attribute'
13:42:17,784 DEBUG Digester:1284 -   No rules found matching 'taglib/tag/attribute'.
13:42:17,784 DEBUG sax:1123 - ignorableWhitespace(
)
13:42:17,815 DEBUG sax:1234 - startElement(,,name)
13:42:17,815 DEBUG Digester:1241 -   Pushing body text ''
13:42:17,815 DEBUG Digester:1260 -   New match='taglib/tag/attribute/name'
13:42:17,830 DEBUG Digester:1284 -   No rules found matching 'taglib/tag/attribute/name'.
13:42:17,830 DEBUG sax:936 - characters(value)
13:42:17,830 DEBUG sax:1004 - endElement(,,name)
13:42:17,830 DEBUG Digester:1007 -   match='taglib/tag/attribute/name'
13:42:17,830 DEBUG Digester:1008 -   bodyText='value'Tomcat无法正常启动,在去掉了这个自定义标签的引用后启动正常。请教各位谁见过这样的情况吗?谢谢了。

解决方案 »

  1.   

    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib
      PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
      "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
      <tlibversion>1.0</tlibversion>
      <jspversion>1.1</jspversion>
      <shortname>Application Tag Library</shortname>
      <uri>http://jakarta.apache.org/taglibs/struts-example-1.0</uri>
      <info>
        This tag library contains functionality for the Venus Struts
        Application.
      </info>  <tag>
        <name>validateSession</name>
        <tagclass>tags.ValidateSessionTag</tagclass>
        <bodycontent>empty</bodycontent>
        <info>
          Validate that there is a currently logged on user, by checking for
          the existence of a session-scope bean under the specified name.
          If there is no such bean, forward control to the specified page,
          which will typically be a logon form.      Attributes:
          name - Name of the session-scope bean to check for
          page - Context-relative path to the logon page
        </info>
        <attribute>
          <name>name</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>page</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
       <tag>
        <name>shownew</name>
        <tagclass>tags.ShownewTag</tagclass>
        <bodycontent>empty</bodycontent>
        <info>
    Displays the new products records from the database that match a given criteria
         </info>
        <attribute>
          <name>page</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
       </tag>
       <tag>
        <name>showcat</name>
        <tagclass>tags.ShowcatTag</tagclass>
        <bodycontent>empty</bodycontent>
        <info>
    Displays the category tables from the database that match a given criteria
         </info>
       </tag>
    </taglib>