求助!!
=================================
环境:
在Weblogic8.1 + Eclipse3.0 + 局域网与internet完全隔离的,下建立自定义标签
=================================
内容:
mytag.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>xmddl 1.1 hello library</description>
  <display-name>xmddl hello</display-name>
  <tlib-version>1.1</tlib-version>
  <short-name>hello</short-name>
  <uri>http://www.xmddl.com/tag</uri> 
  <tag>
    <description>我的Hello World</description>
    <name>hello_int</name>
    <tag-class>HelloTag_Interface</tag-class>
    <body-content>empty</body-content>
  </tag>
</taglib>
web.xml内容:
<taglib>
<taglib-uri>mytag</taglib-uri>
<taglib-location>/WEB-INF/tlds/mytag.tld</taglib-location>
</taglib>
hello.jsp内容
<%@ taglib uri="mytag" prefix="hello" %>
<hello:hello_int/>
=================================
错误:
启动服务器提示错误如下:
"/WEB-INF/tlds/mytag.tld" でタグ ライブラリ記述子を解析中にエラーが発生しました。
("/WEB-INF/tlds/mytag.tld" 发生数据记录解析错误)
运行JSP文件提示错误如下:
"/WEB-INF/tlds/mytag.tld"不正确。DTD cvc-elt.1: Cannot find the declaration of element 'taglib'. (5行、17列)
weblogic.servlet.jsp.JspException: (line -1): cannot load TLD: weblogic.xml.dom.ChildCountException: missing child tagclass in tag
at weblogic.servlet.jsp.TagLibHelper.loadTagLib(TagLibHelper.java:328)
at weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:145)
......
请大家帮忙,谢谢,我已经找了两天了,还不知道应该怎么解决问题。

解决方案 »

  1.   

    请检查一下路径“WEB-INF/tlds/”下面有没有mytag.tld文件。
      

  2.   

    不需要在web.xml文件中配置<taglib>,只管在jsp中引用即可。
      

  3.   

    不行的,好像只有xml3.0以上的不用写web.xml里
    上面的办法不行
      

  4.   

    <%@ taglib uri="mytag" prefix="hello" %>
    <hello:hello_int/>
    ==========================
    <%@ taglib uri="http://www.xmddl.com/tag" prefix="hello" %>
    <hello:hello_int/>
    此处直接引用mytag.tld中定义的<taglib>中的uri不行的,好像只有xml3.0以上的不用写web.xml里
    ==========================
    和xml文件没关系,JSP1.2和JSP2.0的容器均会自动到WEB-INF及META-INF目录下去找.tld文件
      

  5.   

    楼上的大哥,那样的情况我也试验过了,没有成功,错误提示如下
    <2007/04/24 15時04分40秒 CST> <Warning> <HTTP> <BEA-101248> <[ServletContext(id=2829560,name=Sample,context-path=/Sample)]: デプロイメント記述子 "/WEB-INF/tlds/mytag.tld" は正しくありません。DTD cvc-elt.1: Cannot find the declaration of element 'taglib'. (行 5、カラム 17) を確認してください。>大概含义:
    <2007/04/24 15時04分40秒 CST> <Warning> <HTTP> <BEA-101248> <[ServletContext(id=2829560,name=Sample,context-path=/Sample)]: 配置记录 "/WEB-INF/tlds/mytag.tld" 是不正确的。DTD cvc-elt.1: Cannot find the declaration of element 'taglib'. (行 5、列 17) 请确认。>请大家继续帮忙
      

  6.   

    把web.xml文件中关于<taglib>的定义删除掉
      

  7.   

    我已经删掉嘞
    提示错误如下:
    <2007/04/24 15时29分06秒 CST> <Warning> <HTTP> <BEA-101248> <[Sample.war]: 配置文件"web.xml" 不正确 DTD org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'web-app'. (行 1列 10) >
      

  8.   

    给你一个正确的,8.1可能对2的支持不行,你使用这个
    <?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>
    .....
      

  9.   

    重启后这个错误还省一个错误:
    <2007/04/24 15時04分40秒 CST> <Warning> <HTTP> <BEA-101248> <[ServletContext(id=2829560,name=Sample,context-path=/Sample)]: "/WEB-INF/tlds/mytag.tld" 错误。DTD cvc-elt.1: Cannot find the declaration of element 'taglib'. (行 5、列 17) 。>
      

  10.   

    mytag.tld文件不用改。
    你把你的web.xml文件贴出来看看.
      

  11.   

    已经完事了,谢谢大家最后用的是southben() 方法解决的问题马上给分