Results 1 to 2 of 2

Thread: How to get a handler method of a request from the AnnotationMethodHandlerAdapter

  1. #1
    Join Date
    May 2012
    Location
    Florianópolis - Santa Catarina - Brazil
    Posts
    1

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

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •