tomcat启动报错

小北+小杨 发布于 2012/07/20 09:15
阅读 622
收藏 0

web.xml配置:

<?xml version="1.0" encoding="UTF-8"?>
<web-app>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>
  <context-param>
          <param-name>contextConfigLocation</param-name>
          <param-value>
              /WEB-INF/*.xml
          </param-value>
  </context-param>
  <listener>
          <listener-class>
              org.springframework.web.context.ContextLoaderListener
          </listener-class>
  </listener>
  <filter>
          <filter-name>encodingFilter</filter-name>
          <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
          <init-param>
              <param-name>encoding</param-name>
              <param-value>UTF-8</param-value>
          </init-param>
  </filter>
  <filter-mapping>
          <filter-name>encodingFilter</filter-name>
          <url-pattern>*.do</url-pattern>
  </filter-mapping>
</web-app>

我用的spring mvc,新配了一个ContextLoaderListener就报错了,错误是:

cvc-elt.1: Cannot find the declaration of element 'web-app'.

求解。。。各位大哥

加载中
0
红薯
红薯
试试:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:web="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
        version="2.4">
小北+小杨
小北+小杨
解决了,谢谢红薯大哥
返回顶部
顶部