首先我在我的WEB-INF的Classes目录下建了一个标签的执行类。TestTag。包名是mytag然后我在WEB-INF下建了一个TLD文件叫Test里面的配置是:<?xml version="1.0" encoding="UTF-8"?>
<!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>
  <tlib-version>1.0</tlib-version>
  <jsp-version>1.1</jsp-version>
  <tag>
       <name>test</name>
       <tagclass>mytag.TestTag</tagclass>
       <body-content>empty</body-content>
  </tag>
 </taglib>
  我在web.xml下面的配置是这样的
  <taglib>
   <taglib-uri>/test.tld</taglib-uri>
   <taglib-location>/WEB-INF/test.tld</taglib-location>
  </taglib>现在的问题是我在JSP页面下这样:<%@ taglib uri="/test.tld" prefix="mytag" %> 引入这标签库的时候。。MyEclipse总是提示我:Cannot find the tag library descriptor for test

解决方案 »

  1.   

    sorry,不知道是眼花还是头晕居然没有看到。
    你看看是不是这个地方写错了:
    <taglib> 
      <tlib-version>1.0 </tlib-version> 
      <jsp-version>1.1 </jsp-version> 
      <tag> 
          <name>test </name> 
          <tag-class>mytag.TestTag </tagclass> 
          <body-content>empty </body-content> 
      </tag> 
    </taglib>
      

  2.   

    我在web.xml下面的配置是这样的 
      <taglib> 
      <taglib-uri>/test.tld </taglib-uri> 
      <taglib-location>/WEB-INF/test.tld </taglib-location> 
      </taglib> 
    <taglib-location>/WEB-INF/classes/test.tld</taglib-location>
      

  3.   

    还有我的MyEclipse一点保存Console里面就给给这个提示是什么意思啊:
    9/11/08 1:51:49 AM CST: [INFO] User settings file does not exist C:\Documents and Settings\三米\.m2\settings.xml
    9/11/08 1:51:51 AM CST: Error on adding indexing context central; D:\java\Workspace\.metadata\.plugins\org.maven.ide.eclipse\nexus\central\_9.fdt (系统找不到指定的文件。)
    9/11/08 1:51:52 AM CST: [INFO] User settings file does not exist C:\Documents and Settings\三米\.m2\settings.xml
      

  4.   

    这个问题确实没有遇见过。参考这个网址:http://www.javaeye.com/post/621127
      

  5.   

    在web-info下建立一个tld文件 
    <?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 web-jsptaglibrary_2_0.xsd"
         version="2.0">
          <description>My Taglib by Maodie</description>
         <tlib-version>1.0</tlib-version>
         <jsp-version>2.0</jsp-version>
         <short-name>HelloTest</short-name>
         <uri>/mytag</uri>
         <small-icon></small-icon>
        
         <tag>
           <name>stringsplit</name>
           <tag-class>com.helphand.util.StringSplitTag</tag-class>
           <body-content>empty</body-content>
           <attribute>
           <name>value</name>
           <required>true</required>
           <rtexprvalue>true</rtexprvalue>
           </attribute>
           <attribute>
           <name>length</name>
           <required>true</required>
           <rtexprvalue>true</rtexprvalue>
           </attribute>
         </tag>
    </taglib>web.xml不要配置  若你的servlet容器版本不低的 话