This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Spring and the fly likes using spring multiaction controller Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "using spring multiaction controller" Watch "using spring multiaction controller" New topic
Author

using spring multiaction controller

Darvesh Niz
Ranch Hand

Joined: May 12, 2008
Posts: 119
hi guys
i am trying to move from struts mvc to spring mvc. i was reading that you cant use a command object with MultiactionController. is that true.
i have a pretty basic use case of displaying user list, createing new user, editring user etc...
in struts we use RequestDispacthAction where we can target which method to call for each use case with actionForm mapped to your bean.
The same applies with MultiactionController in spring, but how to bind a command object.
Or i have to use SimpleFormController for form submissiion
any links or suggestions
please let me know
darniz
Darvesh Niz
Ranch Hand

Joined: May 12, 2008
Posts: 119
any advice
Darvesh Niz
Ranch Hand

Joined: May 12, 2008
Posts: 119
Any spring experts
or should i rephrase my question if its unclear
Rahul Ba
Ranch Hand

Joined: Oct 01, 2008
Posts: 205
Yes, Rashid...
Can you explain your question a bit more....I am also new to the Spring..but I will try to answer.

Rahul
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
Just declare a parameter, Spring will bind a request to a command object automatically.
Read Javadoc for more details.

SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Darvesh Niz
Ranch Hand

Joined: May 12, 2008
Posts: 119
Thanks kengKaj
I understand that if i am using a simple form controllerr then i can decalre a command object and cast it onSubmit() method.
But for multiaction controller i cant seem i cant set the command Name and commandClass value in spring file
hereis my controller and i am using method name resolver and its working fine to call a specific method in my controller class. i wanted to also add a command object to it but doesn't seem to work.


Thanks
darniz
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: using spring multiaction controller
 
Similar Threads
org.springframework.web.servlet.DispatcherServlet noHandlerFound
How to pass form bean to a MultiActionController
Which Conroller Should Fit Better
Spring MVC multiaction form controller ?
Command Object in MultiActionController