问题描述
在springMVC配置中加入<mvc:resourceslocation="/images/"mapping="/images/**"/>就出错。错误代码:StandardWrapper.Throwableorg.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:Line23inXMLdocumentfromURL[file:/D:/Program%20Files%20(x86)/Genuitec/apache-tomcat-6.0.32/webapps/springMVC3/WEB-INF/classes/config/spring-servlet.xml]isinvalid;nestedexceptionisorg.xml.sax.SAXParseException:cvc-complex-type.2.4.c:Thematchingwildcardisstrict,butnodeclarationcanbefoundforelement'mvc:resources'.atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
解决方案
解决方案二:
配置文件的头文件没有加mvcxmlns:mvc="http://www.springframework.org/schema/mvc"http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:mvc="http://www.springframework.org/schema/mvc"xmlns:context="http://www.springframework.org/schema/context"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.0.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.0.xsdhttp://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-3.0.xsd>http://www.springframework.org/schema/mvchttp://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"></beans>