I am trying my hands on a sample application which uses MultiActionController for handling requests and response. Only problem is it's not working as I expect it to. Here is what I am trying to do.
1. I have index.jsp which is mapped as welcome file in web.xml. This page jusg simply forwards it to the action controller as shown below
2. I have defined my web.xml as below
The problem is when I run the application it throws an error saying "Requested resource not found"
and in the console
Jul 28, 2015 10:35:59 AM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping for [/MultipleActions/] in DispatcherServlet with name 'multipleactions'
I want understand how this multiple action controller is mapped in the servlet.xml file and also how to configure different methods to a url so that on submission proper methods are executed
First, I think you need to have the bean ControllerClassNameHandlerMapping set up. Then, the WelcomeController being the subclass of MultiActionController should be used directly rather than treated as a delegate where methods are being looked for. Also, and I agree that the documentation contains some cryptic statement on like "This method (setDelegate) does not get invoked once the class is configured" which may be the reason that that kind of injection fails... (that is indeed an obscur corner!)
I would rather write and replace the block shown below.
And that should start working.,,
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
a bit of art, as a gift, that will fit in a stocking