• 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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
Hi,

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
Regards
Dilip H P
 
Ranch Hand
Posts: 734
7
  • 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.,,
 
It's a tiny ad only because the water is so cold.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic