I am transitioning code that used implementations of Spring MVC's Controller to use the annotation stereotype @Controller. Everything is going fine except for one issue:
Given a request/response, how do I programmatically handle requests for annotation-based controllers?
Previously, (regardless of implementation) I was able to call:
controller.handleRequest(request, response)
What is the equivalent with annotations? I had assumed there would be some (perhaps static?) utility class along the lines of:
SpringAnnotationBasedControllerUtils.handleRequest(<? extends @Controller> handlerObject, HttpServletRequest request, HttpServletResponse response);
to handle the details of mapping a request to the dynamic signatures allowed by the @Controller stereotype, but I can't find such a thing.
Any suggestions?
(Please no comments on why this is a bad idea or should be unnecessary with a "good" design, etc. This is code under maintenance and must be as noninvasive as possible so a complete re-write is not an option at this time.)
Thanks!