2013-10-07 6 views
11

Ich habe die spring-security-config-3.1.0.RC3 hinzugefügt .jar in meinem lib-Ordner und ich bekomme immer noch diesen Fehler. Was kann möglicher Grund sein ??cvc-complex-type.2.4.c: Der passende Platzhalter ist strikt, aber für das Element 'mvc: annotation-driven' kann keine Deklaration gefunden werden.

Hier ist mein Dispatcher-servlet.xml

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:mvc="http://www.springframework.org/schema/mvc" 
    xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans  
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 

    <context:component-scan base-package="com.tcs.rspm.controller" /> 
<mvc:annotation-driven /> 
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
     <property name="prefix" value="/webpages/" /> 
     <property name="suffix" value=".jsp" /> 
    </bean> 

</beans> 

Antwort

29

Sie haben dies:

xmlns:mvc="http://www.springframework.org/schema/mvc" 

aber du bist es nicht hier zu erwähnen:

xsi:schemaLocation=" 
http://www.springframework.org/schema/beans  
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 

dass zu beheben, Sie sollten

http://www.springframework.org/schema/mvc 
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd 
haben

auch dort, wie

xsi:schemaLocation=" 
http://www.springframework.org/schema/mvc 
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd 
http://www.springframework.org/schema/beans  
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 

Hinweis: es eigentlich üblich ist, dass Schema Referenzen erwähnen Frühling Version nicht für eine einfachere Aufrüstung zu ermöglichen, so dass Sie Referenzen wie http://www.springframework.org/schema/context/spring-context.xsd auch nutzen könnten.

Verwandte Themen