본문 바로가기
프로그램/Spring

[Spring] cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:interceptors'.

by 로드러너 2014. 1. 29.
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:interceptors'

오류는 spring-servlet.xml 파일 안에서 <mvc:interceptors> 태그를 사용하는 경우에 발생한다.

 

spring-servlet.xml 파일 안에서 <mvc:interceptors> 태그를 사용하기 위해서는 <beans>태그에 다음 값들을 추가해 주어야 한다.

 

<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.xsd   

 http://www.springframework.org/schema/context 

 http://www.springframework.org/schema/context/spring-context.xsd    

 http://www.springframework.org/schema/mvc

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

         
    <context:annotation-config />
    <context:component-scan base-package="net.viralpatel.spring3.controller"/>
     
    <mvc:interceptors>
      <bean class="클래스경로" />
    </mvc:interceptors>