• [프로그래밍] mvc annotation driven conflict with HandlerInterceptor2011.11.08 PM 06:01

게시물 주소 FONT글자 작게하기 글자 키우기

If your Spring mvc application use

<mvc:annotation-driven />

tag then your interceper must be set like below sample
without <mvc:interceptors> tags your interceptor will be ignored.

<mvc:interceptors>
<beans:bean id="dateRequestHeaderInterceptor"
class="com.test.service.DateRequestHeaderInterceptor" />
</mvc:interceptors>

<beans:bean id="defaultAnnotationHandlerMapping"
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<beans:property name="order" value="1" />
<beans:property name="alwaysUseFullPath" value="true" />
</beans:bean>

<beans:bean id="selectedAnnotationHandlerMapping"
class="org.springplugins.web.SelectedAnnotationHandlerMapping">
<beans:property name="alwaysUseFullPath" value="true" />
<beans:property name="order" value="0" />
<beans:property name="urls">
<beans:list>
<beans:value>/svc1*</beans:value>
<beans:value>/svc2*</beans:value>
</beans:list>
</beans:property>
<beans:property name="interceptors">
<beans:list>
<beans:bean class="com.test.service.DateRequestHeaderInterceptor" />
</beans:list>
</beans:property>
</beans:bean>
댓글 : 0 개
친구글 비밀글 댓글 쓰기

user error : Error. B.