We need to use <mvc:annotation-driven/> in our project to support JSR 303 validations. At the same time we need to extend org.springframework.web.servlet.mvc.annotation.Ann otationMethodHandlerAdapter and override protected HttpInputMessage createHttpInputMessage.
Using <mvc:annotation-driven/> prevents from from doing so. I looked the source code for <mvc:annotation-driven/> (AnnotationDrivenBeanDefinitionParser.java) at it looks like they always create an instance of AnnotationMethodHandlerAdapter which prevents the spring container from using my custom AnnotationMethodHandlerAdapterCode:public class AnnotationMethodHandlerAdapter extends org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter { public AnnotationMethodHandlerAdapter() { System.out.println("In mY custom handler"); } @Override protected HttpInputMessage createHttpInputMessage(HttpServletRequest servletRequest) throws Exception { return new ServletServerHttpRequest(servletRequest); } }
Has anyone faced similar issues


Reply With Quote