복붙노트

[SPRING] cvc-complex-type.2.4.c : 일치하는 와일드 카드가 엄격하지만 'mvc : annotation-driven'요소에 대한 선언을 찾을 수 없습니다.

SPRING

cvc-complex-type.2.4.c : 일치하는 와일드 카드가 엄격하지만 'mvc : annotation-driven'요소에 대한 선언을 찾을 수 없습니다.

내 lib 폴더에 spring-security-config-3.1.0.RC3.jar을 추가 했는데도 여전히이 오류가 발생합니다. 가능한 이유는 무엇입니까 ??

다음은 내 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>

해결법

  1. ==============================

    1.당신은 이것을 가지고 있습니다 :

    당신은 이것을 가지고 있습니다 :

    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">
    

    이 문제를 해결하려면

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

    거기에

    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">
    

    참고 : 실제로 스키마 참조는 스프링 업을 쉽게 업그레이드 할 수 있도록 언급하지 않으므로 http://www.springframework.org/schema/context/spring-context.xsd와 같은 참조를 사용해야합니다. 이름에 -3.0을 가졌다.

  2. from https://stackoverflow.com/questions/19218122/cvc-complex-type-2-4-c-the-matching-wildcard-is-strict-but-no-declaration-can by cc-by-sa and MIT license