May 9th, 2012, 03:45 PM
How to get a handler method of a request from the AnnotationMethodHandlerAdapter
I'm creating a custom annotation to define in methods with a @RequestMapping annotation a list of mixins to be add in the ObjectMapper attribute of the MappingJacksonHttpMessageConverter. I extended MappingJacksonHttpMessageConverter, did a override of readInternal(Class<?> clazz, HttpInputMessage inputMessage) method and now I need to know the method with the @RequestMapping annotation that will handle, to read from it the mixins and add all before MappingJacksonHttpMessageConverter convert json to object.
I studied AnnotationMethodHandlerAdapter and saw that getMethodResolver(handler) and its inner map are both private, so I can't do methodResolver.resolveHandlerMethod(request) in a extended class. Now I was wondering if have a way to get this handler method without doing dirty things like copy and paste code of class AnnotationMethodHandlerAdapter.
I'll appreciate any help, thanks in advance.
Jun 13th, 2012, 06:44 PM
I have same issue in spring-webmvc-3.0.5. AnnotationMethodHandlerAdapter not extensible. I need to add custom Annotation to method which need to be intercepted.