Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing object from jsp to action

 
tushar bhasme
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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)?

Thanks.
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just create a SSCCE * version of your code
 
vivek jose
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic