I already have an interceptor from a pre-2.5 Spring application. Now, I have an annotation controller which shall be applied for the same interceptor for a business logic validation. Is it doable?
I already have an interceptor from a pre-2.5 Spring application. Now, I have an annotation controller which shall be applied for the same interceptor for a business logic validation. Is it doable?
[URL="http://vicina.info"] 新闻,社区新闻,分类广告
Just like you do it with the other interceptors. Configure the appropriate HandlerMapping and inject the interceptors into it.
Marten Deinum
Java Consultant / Pragmatist / Open Source Enthousiast / Author
Pro Spring MVC: With Web Flow
Conspect
Have you read the reference guide.
Use the [ code ] tags, young padawan
Thanks for the information. I, however, am not sure how it works out. The pre-2.5 way is the followings:
For the annotation controller, I can replace the SimpleUrlHandlerMapping with DefaultAnnotationHandlerMapping. I, however, can't find how to map it with the controller. The interceptor shall not be applied to all annotation controllers, but that one. I can't see any document in the regard including the Spring API document (/spring-framework-2.5.6/docs/api/index.html). The API document mentions about the "interceptors" property, but nothing else. Or, I shall use a customized build like this one: http://www.scottmurphy.info/spring_f...inter ceptorsCode:<bean id="editBusinessEntryHandlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="interceptors"> <list> <ref bean="businessOwnerInterceptor"/> </list> </property> <property name="urlMap"> <map> <entry key="/directory/editEntry.htm"><ref local="editingEntryFormController"/></entry> </map> </property> </bean>
Last edited by vw729; May 30th, 2009 at 08:03 PM.
[URL="http://vicina.info"] 新闻,社区新闻,分类广告