无法找到元素'mvc:annotationDriven'的声明

时间:2017-11-23 11:59:23

标签: spring

这是我的servlet:

<?xml version="1.0" encoding="UTF-8"?>
<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:aop="http://www.springframework.org/schema/aop" 
     xmlns:mvc="http://www.springframework.org/schema/mvc"
     xsi:schemaLocation="
     http://www.springframework.org/schema/beans 
     classpath:/org/springframework/beans/factory/xml/spring-beans-3.0.xsd 
     http://www.springframework.org/schema/context 
     classpath:/org/springframework/context/config/spring-context-3.0.xsd
    http://www.springframework.org/schema/aop 
    classpath:/org/springframework/aop/config/spring-aop-3.0.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"> 

<mvc:annotationDriven/>

<context:component-scan base-package="com.demo.ontrollers"></context:component-scan>

<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="WEB-INF/jsp/"/>
    <property name="suffix" value=".jsp" />
</bean>

有人可以帮助我,或者告诉我哪里可以看到我的Spring版本?

1 个答案:

答案 0 :(得分:0)

<mvc:annotation-driven/> 

<mvc:annotationDriven/><mvc:annotation-Driven/>

都不<mvc:notation-Driven>

另外,请勿明确添加xsd

的版本