• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maintaining ActionForm data between Actions

 
Mario Romero
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • 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.
 
Christian Nash
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic