jQuery in Action, 3rd edition
The moose likes Struts and the fly likes passing object from jsp to action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "passing object from jsp to action" Watch "passing object from jsp to action" New topic

passing object from jsp to action

tushar bhasme
Ranch Hand

Joined: Feb 11, 2008
Posts: 50

I am new to struts. I am working on an application and facing a few difficulties, any help would be highly appreciated.
- I have a ValueObject in my action which I am using on my jsp. The VO has some text fields and a String Map. Through OGNL expressions, the text field values get set to the VO, but the Map is not getting updated. Currently, I am setting the Map in session on the jsp, and then setting it back to the VO in the action, which I don't want to do. I am wondering if I am not specifying the Map field in my acceptableParameterName. I have specified the map as <VO>.<mapName>. Is it correct?
- Is it possible to pass the whole updated VO back to the Action (instead of setting the value of each field) just like it gets set from Action to the jsp (when its defined as a parameter)?

Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Just create a SSCCE * version of your code

ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
vivek jose

Joined: Sep 08, 2013
Posts: 3
Yes you can pass the entire VO back
<logic:iterate name="monthlyGainLossForm" property="ptcList" id="productTaxCat">
just give your VO as ID and your form will pick up values and pass to action
I agree. Here's the link: http://aspose.com/file-tools
subject: passing object from jsp to action
It's not a secret anymore!