It's not a secret anymore!
The moose likes Spring and the fly likes Command Object in MultiActionController Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Command Object in MultiActionController" Watch "Command Object in MultiActionController" New topic

Command Object in MultiActionController

sandeep lokhande
Ranch Hand

Joined: Jan 25, 2010
Posts: 118

I am new to spring,
i want to know whether Command Object is available in MultiactionController having some Method?
If yes then how can you use that?

Suggest me any study material that will explain this concept,
Thank you in advance.

Thanks and Regards,
Sandeep Lokhande.
Frank Truong
Ranch Hand

Joined: Nov 19, 2002
Posts: 39

I have been struggling with MultiActionController object as well.

Here is my observation:

If I passed a session object as 3rd parameter, I got the session object without doing anything extra. If I passed a command object as 3rd parameter, I got a null object passed in. I agree. Because I haven't seen any where in Spring that tells MultiActionController about this command object yet. Then, I overrided the newCommandObject(Class) method to return a (new)copy of this command object, I got request parameters pushed into this object automatically by Spring.

Make sure the form input parameters match the attributes of command object. Just like ActionForm in Struts.

This is just my observation, again.


P.S. Command object can be passed as 4th parameter as well!
I agree. Here's the link:
subject: Command Object in MultiActionController
It's not a secret anymore!