匹配的通配符是严格的,但是找不到元素'mvc:resources'的声明

时间:2016-06-03 06:01:28

标签: xml spring-mvc xsd

这是我的spring-servlet.xml:

<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
        xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/aop 
        http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/tx 
        http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
        http://www.springframework.org/schema/task
      http://www.springframework.org/schema/task/spring-task-3.0.xsd
      http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
        <mvc:resources mapping="/CSS/**" location="../CSS/" />
        <mvc:resources mapping="/scripts/**" location="../scripts/" />
        <context:component-scan base-package="com.zensar.controllers" />
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="prefix" value="/views/" />
            <property name="suffix" value=".jsp" />
        </bean>
      </beans>

和web.xml是

<?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/javaee"   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID"   version="3.0">
        <display-name>SpringMvc</display-name>
        <welcome-file-list>
          <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
        <servlet>  
          <servlet-name>spring</servlet-name>  
          <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
          <load-on-startup>1</load-on-startup>  
      </servlet>  
      <servlet-mapping>  
          <servlet-name>spring</servlet-name>  
          <url-pattern>/</url-pattern>  
      </servlet-mapping>
      </web-app>

运行我的项目后出现错误:

  

匹配的通配符是严格的,但是找不到元素'mvc:resources'

的声明

0 个答案:

没有答案