AnnotationMethodHandlerAdapter는 캐시 헤더를 설정하는 기능을 제공하고 있다.
따라서, 모든 컨트롤러에 동일한 캐시 옵션을 설정해야 할 경우, 중복없이 AnnotationMethodHandlerAdapter의 캐시 관련 프로퍼티를 이용해서 동일한 캐시 헤더를 설정할 수 있다.

  <bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="cacheSeconds" value="0" />
<property name="alwaysUseFullPath" value="true" />
<property name="webBindingInitializer">
<bean class="madvirus.spring.chap06.binder.CustomWebBindingInitializer" />
</property>
<property name="messageConverters">
<list>
<ref bean="byteArrayHttpMessageConverter" />
<ref bean="stringHttpMessageConverter" />
<ref bean="formHttpMessageConverter" />
<ref bean="sourceHttpMessageConverter" />
<ref bean="marshallingHttpMessageConverter" />
<ref bean="jsonHttpMessageConverter" />
</list>
</property>
</bean>

cacheSeconds 값이 0 : 캐시를 하지 않도록 헤더를 생성 / -1 : 캐시관련 헤더를 생성하지 않음 / 1 이상: 해당 시간만큼 캐시하도록 헤더설정







 

'IT > 스프링' 카테고리의 다른 글

@RequestBody , @ResponseBody  (0) 2012.01.20
WebApplicationContext 직접접근?  (0) 2012.01.19
HandlerInterceptor  (0) 2012.01.19
파일 업로드 in spring... 3  (1) 2012.01.18
Validator / Error interface .... in Spring  (0) 2012.01.16

+ Recent posts