“mvc:annotation-driven”能够换成任何xml标签,spring
发生错误时的配置以下:spring-mvc
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd ">mvc
这个错误的根本缘由在于,spring容器启动时,XmlBeanDefinitionReader类既没法经过spring的jar包的META-INFO/spring.schemas文件的映射到jar包中的相应的的xsd文件,又没法经过联网直接从http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd地址读取到相应的xsd文件。xml