<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd"
         version="2.4">
改成
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

解决方案 »

  1.   

    <taglib xmlns="http://java.sun.com/xml/ns/j2ee"
             xmlns:xsi="http://w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
             version="2.0">
        <description>A tag library exercising SimpleTag handlers.</description>
        <tlib-version>1.0</tlib-version>
        <short-name>examples</short-name>
        <uri>/MyTAG</uri>
        <description>A simple tab library for examples</description>
       <tag>
            <description>Output Hello world.</description>
            <name>hello_int</name>
            <tag-class>mytag.HelloTag_Interface</tag-class>
            <body-content>empty</body-content>
       </tag>
    </taglib>
    我的书上是:
    <taglib xmlns="http://java.sun.com/xml/ns/j2ee"
             xmlns:xsi="http://w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
             version="2.0">
        <description>A tag library exercising SimpleTag handlers.</description>
        <tlibversion>1.0</tlibversion>
        <shortname>examples</shortname>
        <uri>/MyTAG</uri>
        <description>A simple tab library for examples</description>
       <tag>
            <description>Output Hello world.</description>
            <name>hello_int</name>
            <tagclass>mytag.HelloTag_Interface</tagclass>
            <bodycontent>empty</bodycontent>
       </tag>
    </taglib>
      

  2.   

    to  zhutouzip(Speak out!-shyboy):
       谢谢,已经修改,但出现新的问题,error为:
      Error: "TAGjsp.jsp":org.apache.jasper.JasperException: XML parsing error on file /WEB-INF/web.xml:(line 3,col -1):组件类型"taglib"未被声明。
    to  nimifeng(蜜蜂不小了.):
       不好意思,我看不出两段程序有什么区别
      

  3.   

    你只需要在web.xml中那样改,tld文件中不需要改!
      

  4.   

    后面的这个<taglib>应为</taglib>
      

  5.   

    我就是在web.xml中改的啊,tld中间没有web-app,我想改也没有地方啊
      

  6.   

    谢谢,已修改.web.xml那里的那个是我手误打错了.还是弹出错误:Error: "TAGjsp.jsp":org.apache.jasper.JasperException: XML parsing error on file /WEB-INF/tlds/mytag.tld:(line 3,col -1):组件类型"taglib"未被声明。在tld文件中怎么会没有申明taglib呢?
      

  7.   

    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    将这一行加到你的mytag.tld文件中的第二行,也就是<?xml...>的后面
      

  8.   

    加了,报错如下:
    Warn:Invalid PUBLIC ID :-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN
    Error:"TAGjsp.jsp":org.apache.jasper.JasperException: XML parsing error on file /WEB-INF/tlds/mytag.tld:(line 3,col -1):未找到外部实体"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"
      

  9.   

    不可能吧?
    如果这样干脆将<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
             xmlns:xsi="http://w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
             version="2.0">
    换成<taglib>
    然后在第二行加上刚才的一句!
    随便找一个配置正确的tld文件,按着它配置就行了!
      

  10.   

    已修改,但是弹出和先前一模一样的错误:未找到外部实体"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"
    我也想找一个配置正确的tld文件啊,问题是这些书上说的"正常的"tld文件,在我这里都报错
      

  11.   

    好的,辛苦你了。我再看看。其实就像我一开始做RMI出错一样,代码全都是正确的,就是配置的问题。缺了一步,别人运行正常的,我就是报错。希望以后慢慢就好了.............