你没有web-jsptaglibrary_1_2.dtd这个文件

解决方案 »

  1.   

    可能你的xml有些问题,检查一下是否正确
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
    "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    如果不行换这个试试
    http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
      

  2.   

    你这样试一下,<!DOCTYPE taglib 
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "">引用的外部实体是不是定义错误了!
      

  3.   

    web-jsptaglibrary_1_2.dtd这个文件应该放在哪里?我用的是jbuilder!
    我检查了,我的taglib描述文件没有错误!!!
      

  4.   

    好像是你的tld文件写错了吧。。它提示你找不到
    未找到外部实体“http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd”。你自己分析一下你的tld文件。是不是真的错了?
      

  5.   


    认真看过了,没有错误,原文件为:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystem,Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
      <tlib-version>1.0</tlib-version>
      <jsp-version>1.2</jsp-version>
      <short-name>simple</short-name>
      <description>Examples for the Simple Tags chapter</description>
    <tag>
      <name>date</name>
      <tag-class>liutag.date.DateTag</tag-class>
      <body-content>empty</body-content>
      <description>Inserts the current date into the page</description>
    </tag>
    </taglib>
    按上面的任兄的意见,没有解决问题,
    "tagtest.jsp": org.apache.jasper.JasperException: XML parsing error on file /WEB-INF/tlds/simple.tld: (line 2, col -1): 相关的 URI ""; 没有基本的 URI,不能解决。
      

  6.   

    先看看web.xml有没有对自定义的tld文件进行定位
    然后是自己写的.tld文件
    最后别忘了在JSP页面上引用tld
      

  7.   

    例子:
    1、web.xml文件中
      <taglib>
        <taglib-uri>/WEB-INF/taglib.tld</taglib-uri>
        <taglib-location>/WEB-INF/taglib.tld</taglib-location>
      </taglib>2、taglib.tld<?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib
      PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
      "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
      <tlib-version>1.0</tlib-version>
      <jsp-version>1.2</jsp-version>
      <short-name>guard</short-name>
      <description>
    A tab for guard resources
      </description>  <tag>
        <name>page</name>
        <tag-class>cwc.util.GuardTag</tag-class>
        <description>
          gurad client IPs
        </description>
      </tag>  <tag>
        <name>paragraph</name>
        <tag-class>cwc.util.IpTag</tag-class>
        <body-content>JSP</body-content>
        <description>
          guard content.
        </description>
       </tag>
    </taglib>3、JSP中<%@ taglib uri="/WEB-INF/taglib.tld" prefix="guard" %>
    <guard:page/>