Announcement Announcement Module
Collapse
No announcement yet.
How to get a handler method of a request from the AnnotationMethodHandlerAdapter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to get a handler method of a request from the AnnotationMethodHandlerAdapter

    Hi,

    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.
    Best regards.

  • #2
    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.

    Comment

    Working...
    X