• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Maintaining ActionForm data between Actions

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a way I can retrieve the values of a Form in a 2� Action which I set on the 1� Action?

This is my scenario:

Struts-config


1� Action


the Form


The JSP takes the Form values of "listaNoticias" correctly, and submits to another action:

2� Action


And that didn�t work because the form values are lost. Why?

I tried making the scope as session in the struts-config action-path but didn�t work.
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The values come up as empty because you may not be sending this arrayList as a parameter during jsp form submit to Action 2 or some error in the jsp. Please post the jsp.
 
Mario Romero
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In fact, I�m not sending the ArrayList, and dont want to do it.

From pages I found I though that Form values are maintained through JSP�s without the need of repopulating the Form again, but the ArrayList and all of the multiple fields I have in the form are reseted, or the form is created again for each request.

Is there a way to keep the data in a structs-way without resorting to public variables or whatever?

Thanks to another member I found this:
<bean:define id="name" name="MyForm" property="MyFormField" type="java.util.Collection" />

I have to try that yet, but it makes sense that since MyFormField is in the jsp, the form will take the value in the request.
I find it cumbersome and not very efficient but this monday I have to finish this so...
 
Mario Romero
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...It didn�t work. How can I submit the Arraylist then?

This is a trimmed down version of my JSP:


Sorry about the mess, I�m still learning and merging a lot of things at once.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic