• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to invoke method using controller class in spring

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

How to invoke multiple method using controller class in spring.

if you have code or any web references please send me.

Thanks in advance.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you explain what you want to do ? What do you mean by "invoke multiple method using controller class" ?
 
Mohan rvscas
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sir,

i want to call method that is inside the class. see MultiActionControllerEx1.java this java file that extends MultiActionController and it has one method add().

now i have jsp (redirect.jsp). in this jsp i have one anchor tag. it shoult call add method of the class (MultiActionControllerEx1.java) .

i have tried but i didn't get the output .

Error is occured like

HTTP Status 404 - /MultiActionSpring/user.htm/add

type Status report

message /MultiActionSpring/user.htm/add

description The requested resource (/MultiActionSpring/user.htm/add) is not available.
Apache Tomcat/6.0.20


i don't know how where i did the mistake .

This is my code .

redirect.jsp







MultiActionControllerEx1.java








dispatcher-servlet.xml








user.jsp







web.xml





sir this is what i have tried.

please give me the solution.

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
/MultiActionSpring/user.htm/add ? Your DispatcherServlet is mapped to *.htm. The request associated to that URL will not be processed by the dispatcher. I see at least two problems
1. You defined a method name parameter called "method", but you are not using it
2. You mapped the controller to /user/*.htm but you are linking to user.htm in your JSP

I think you should change "<a href="user.htm/add">Add</a> " to something like "<a href="/yourcontext/user/something.htm?method=add">Add</a>", where "yourcontext" is the name of your application (should be set dynamically). I'm not sure it's wise to map the controller to /user/*.htm.
 
Mohan rvscas
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dear Christophe,

now i made changes in mapping it works fine.

Thanks a lot.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic