I'm trying to get hold of the <mvc:annotation-driven /> created AnnotationMethodHandlerAdapter from the ApplicationContext. I'm able to get hold of this usingwhich is working for me.Code:AnnotationMethodHandlerAdapter annotationMethodHandlerAdapter = (AnnotationMethodHandlerAdapter)context.getBean(AnnotationMethodHandlerAdapter.class);
However this might break in case someone tries to configure the AnnotationMethodHandlerAdapter say add extra message converters and still keep the <mvc:annotation-driven />.
Is there any default bean name that the <mvc:annotation-driven /> assigns to the instance of the AnnotationMethodHandlerAdapter so that i could make use of that?
Thanks.


Reply With Quote
