能帮帮忙看看 这个web.xml哪里错了阿?

时间:2022-09-05 21:43:31
我用的jb2005检查出现web.xml有如下两个错误,但是怎么咱也找不出来


src-resolve: Cannot resolve the name 'j2ee:jsp-configType' to a(n) type definition component.

src-resolve: Cannot resolve the name 'j2ee:jsp-fileType' to a(n) type definition component.



--------------------------------------------web.xml-------------------------------------


<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd"
>


<web-app 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 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

  <display-name>JSP</display-name>
  <description>
    JSP
  </description>
  <filter>
     <filter-name>managerAuth</filter-name>
     <filter-class>com.jspdev.filter.ManagerFilter</filter-class>
     <init-param>
             <param-name>manager</param-name>
             <param-value>0</param-value>
     </init-param>
    </filter>
    <filter>
     <filter-name>encoding</filter-name>
     <filter-class>com.jspdev.ch8.EncodingFilter</filter-class>
     <init-param>
             <param-name>encoding</param-name>
             <param-value>gb2312</param-value>
     </init-param>
    </filter>
    <filter>
     <filter-name>auth</filter-name>
           <filter-class>com.jspdev.filter.SignonFilter</filter-class>
    </filter>

    <filter-mapping>
       <filter-name>encoding</filter-name>
       <url-pattern>/*</url-pattern>
     </filter-mapping>

    <filter-mapping>
       <filter-name>managerAuth</filter-name>
       <url-pattern>/manage1/*</url-pattern>
   </filter-mapping>

    <servlet>
        <servlet-name>ViewMessageServlet</servlet-name>
        <servlet-class>com.jspdev.ch9.ViewMessageServlet</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>login</servlet-name>
        <jsp-file>/index.jsp</jsp-file>
    </servlet>
     <servlet>
        <servlet-name>TestServletConfig</servlet-name>
        <servlet-class>com.jspdev.servlet.test.TestServletConfig</servlet-class>
    </servlet>
     <servlet>
        <servlet-name>AddMessageServlet</servlet-name>
        <servlet-class>com.jspdev.ch9.AddMessageServlet</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>forumservlet</servlet-name>
        <servlet-class>com.jspdev.servlet.ForumServlet</servlet-class>
    </servlet>
     <servlet>
        <servlet-name>newtopicservlet</servlet-name>
        <servlet-class>com.jspdev.servlet.NewTopicServlet</servlet-class>
    </servlet>
     <servlet>
        <servlet-name>edittopicservlet</servlet-name>
        <servlet-class>com.jspdev.servlet.EditTopicServlet</servlet-class>
    </servlet>
     <servlet>
        <servlet-name>deletetopicservlet</servlet-name>
        <servlet-class>com.jspdev.servlet.DeleteTopicServlet</servlet-class>
    </servlet>
     <servlet>
        <servlet-name>replytopicservlet</servlet-name>
        <servlet-class>com.jspdev.servlet.ReplyTopicServlet</servlet-class>
    </servlet>
     <servlet-mapping>
        <servlet-name>ViewMessageServlet</servlet-name>
        <url-pattern>/viewMessages_servlet</url-pattern>
    </servlet-mapping>
     <servlet-mapping>
        <servlet-name>AddMessageServlet</servlet-name>
        <url-pattern>/addMessages_servlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>TestServletConfig</servlet-name>
        <url-pattern>/servlet/test</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>login</servlet-name>
        <url-pattern>/login</url-pattern>
    </servlet-mapping>
     <servlet-mapping>
        <servlet-name>forumservlet</servlet-name>
        <url-pattern>/servlet/forumservlet</url-pattern>
    </servlet-mapping>
      <servlet-mapping>
        <servlet-name>newtopicservlet</servlet-name>
        <url-pattern>/servlet/newtopicservlet</url-pattern>
    </servlet-mapping>
      <servlet-mapping>
        <servlet-name>edittopicservlet</servlet-name>
        <url-pattern>/servlet/edittopicservlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>deletetopicservlet</servlet-name>
        <url-pattern>/servlet/deletetopicservlet</url-pattern>
    </servlet-mapping>

     <servlet-mapping>
        <servlet-name>replytopicservlet</servlet-name>
        <url-pattern>/servlet/replytopicservlet</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>index.html</welcome-file>
    </welcome-file-list>

<jsp-config>
  <taglib>
        <taglib-uri>http://hellking.com/function</taglib-uri>
        <taglib-location>/WEB-INF/functions.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
    <taglib-location>/WEB-INF/fmt.tld</taglib-location>
</taglib>

<taglib>
    <taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri>
    <taglib-location>/WEB-INF/fmt-rt.tld</taglib-location>
</taglib>

<taglib>
    <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
    <taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>

<taglib>
    <taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri>
    <taglib-location>/WEB-INF/c-rt.tld</taglib-location>
</taglib>

<taglib>
    <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
    <taglib-location>/WEB-INF/sql.tld</taglib-location>
</taglib>

<taglib>
    <taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri>
    <taglib-location>/WEB-INF/sql-rt.tld</taglib-location>
</taglib>

<taglib>
    <taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
    <taglib-location>/WEB-INF/x.tld</taglib-location>
</taglib>

<taglib>
    <taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri>
    <taglib-location>/WEB-INF/x-rt.tld</taglib-location>
</taglib>
</jsp-config>
</web-app>

6 个解决方案

#1


好长阿,你把你认为有疑问的地方指出来吧

#2


就是上面两个错误阿,我也不知道错在哪啊,就是上面提示的两个错误,大家帮帮忙啊
 
jb的提示就在这行:
------------------------------------------------------
<web-app 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 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
-----------------------------------------------------

#3


你把<jsp-config>和</jsp-config>这两个标记去掉

#4


如果把:“<jsp-config>和</jsp-config>这两个标记去掉”

在上面那两个错误的基础上还增加了一条错误


cvc-complex-type.2.4.a: Invalid content starting with element 'taglib'. One of '{"http://java.sun.com/xml/ns/j2ee":description, "http://java.sun.com/xml/ns/j2ee":display-name, "http://java.sun.com/xml/ns/j2ee":icon, "http://java.sun.com/xml/ns/j2ee":distributable, "http://java.sun.com/xml/ns/j2ee":context-param, "http://java.sun.com/xml/ns/j2ee":filter, "http://java.sun.com/xml/ns/j2ee":filter-mapping, "http://java.sun.com/xml/ns/j2ee":listener, "http://java.sun.com/xml/ns/j2ee":servlet, "http://java.sun.com/xml/ns/j2ee":servlet-mapping, "http://java.sun.com/xml/ns/j2ee":session-config, "http://java.sun.com/xml/ns/j2ee":mime-mapping, "http://java.sun.com/xml/ns/j2ee":welcome-file-list, "http://java.sun.com/xml/ns/j2ee":error-page, "http://java.sun.com/xml/ns/j2ee":jsp-config, "http://java.sun.com/xml/ns/j2ee":security-constraint, "http://java.sun.com/xml/ns/j2ee":login-config, "http://java.sun.com/xml/ns/j2ee":security-role, "http://java.sun.com/xml/ns/j2ee":env-entry, "http://java.sun.com/xml/ns/j2ee":ejb-ref, "http://java.sun.com/xml/ns/j2ee":ejb-local-ref, "http://java.sun.com/xml/ns/j2ee":service-ref, "http://java.sun.com/xml/ns/j2ee":resource-ref, "http://java.sun.com/xml/ns/j2ee":resource-env-ref, "http://java.sun.com/xml/ns/j2ee":message-destination-ref, "http://java.sun.com/xml/ns/j2ee":message-destination, "http://java.sun.com/xml/ns/j2ee":locale-encoding-mapping-list}' is expected.

#5


把<jsp-config>和</jsp-config>这两个标记去掉
包括里面的子元素.
    部署标签库可能有问题,JSTL的不要部署了,
把JAR文件拷到lib目录中就直接可以用了,
至于你自已的第一个标签库,怎么部署,
你再找一下资料.

#6


哪些jar文件阿??

是不是stander.jar,这个阿???

#1


好长阿,你把你认为有疑问的地方指出来吧

#2


就是上面两个错误阿,我也不知道错在哪啊,就是上面提示的两个错误,大家帮帮忙啊
 
jb的提示就在这行:
------------------------------------------------------
<web-app 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 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
-----------------------------------------------------

#3


你把<jsp-config>和</jsp-config>这两个标记去掉

#4


如果把:“<jsp-config>和</jsp-config>这两个标记去掉”

在上面那两个错误的基础上还增加了一条错误


cvc-complex-type.2.4.a: Invalid content starting with element 'taglib'. One of '{"http://java.sun.com/xml/ns/j2ee":description, "http://java.sun.com/xml/ns/j2ee":display-name, "http://java.sun.com/xml/ns/j2ee":icon, "http://java.sun.com/xml/ns/j2ee":distributable, "http://java.sun.com/xml/ns/j2ee":context-param, "http://java.sun.com/xml/ns/j2ee":filter, "http://java.sun.com/xml/ns/j2ee":filter-mapping, "http://java.sun.com/xml/ns/j2ee":listener, "http://java.sun.com/xml/ns/j2ee":servlet, "http://java.sun.com/xml/ns/j2ee":servlet-mapping, "http://java.sun.com/xml/ns/j2ee":session-config, "http://java.sun.com/xml/ns/j2ee":mime-mapping, "http://java.sun.com/xml/ns/j2ee":welcome-file-list, "http://java.sun.com/xml/ns/j2ee":error-page, "http://java.sun.com/xml/ns/j2ee":jsp-config, "http://java.sun.com/xml/ns/j2ee":security-constraint, "http://java.sun.com/xml/ns/j2ee":login-config, "http://java.sun.com/xml/ns/j2ee":security-role, "http://java.sun.com/xml/ns/j2ee":env-entry, "http://java.sun.com/xml/ns/j2ee":ejb-ref, "http://java.sun.com/xml/ns/j2ee":ejb-local-ref, "http://java.sun.com/xml/ns/j2ee":service-ref, "http://java.sun.com/xml/ns/j2ee":resource-ref, "http://java.sun.com/xml/ns/j2ee":resource-env-ref, "http://java.sun.com/xml/ns/j2ee":message-destination-ref, "http://java.sun.com/xml/ns/j2ee":message-destination, "http://java.sun.com/xml/ns/j2ee":locale-encoding-mapping-list}' is expected.

#5


把<jsp-config>和</jsp-config>这两个标记去掉
包括里面的子元素.
    部署标签库可能有问题,JSTL的不要部署了,
把JAR文件拷到lib目录中就直接可以用了,
至于你自已的第一个标签库,怎么部署,
你再找一下资料.

#6


哪些jar文件阿??

是不是stander.jar,这个阿???