aspose file tools*
The moose likes Struts and the fly likes Data Retention in JSPs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Data Retention in JSPs" Watch "Data Retention in JSPs" New topic
Author

Data Retention in JSPs

Klament J. Kruoghst
Ranch Hand

Joined: Oct 24, 2008
Posts: 35
Hi there, I need to retain the values from a form. In the example below given in Data Retention example I can save an array of objects in the form by just using this code (my JSP code is definitely better designed than this, I'm using tags but the point is to show how the object gets copied from the form to the javabean class:





It all works fine when the property of the object is a string, but I have a List as a property, so my object would look like:


instead of


How can i modify the javabean code above to make it work for array properties or if I have to add the code the the beanObj element that also works but nothing's work so far.

Thanks!
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8713
    
    6

Read the comments for that article. Not something you want to emulate.

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Klament J. Kruoghst
Ranch Hand

Joined: Oct 24, 2008
Posts: 35
Joe Ess wrote:Read the comments for that article. Not something you want to emulate.


Yes I know hence my comment:
... I can save an array of objects in the form by just using this code (my JSP code is definitely better designed than this, I'm using tags but the point is to show how the object gets copied from the form to the javabean class


The point of all this is not the way they're displaying the JSP, I'm using proper tags, the code i'm using and i need to change is the actual java code in the javabean, that as far as i know is the only way to save the object to the form in struts, and that's the one i need to save in an array.

Cheers,
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Data Retention in JSPs
 
Similar Threads
dependable or linked dropdown lists
2-dimentional array
Display Check Boxes & Dropdowns in Struts with search results
Getting user defined object
Struts ArrayList Display in JSP