• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Spring MVC 2.5: Using MultiActionController.

Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

3. multipleactions-servlet.xml

4. WelcomeController.java

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

Please help
Dilip H P
Ranch Hand
Posts: 734
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
    Bookmark Topic Watch Topic
  • New Topic