You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kam Lung Leung <kl...@wlwa.com> on 2003/11/03 20:18:27 UTC

how to retrieve property values from previous forms/jsp pages

Hi,

I need to retrieve property values from previous pages that were inputted by the
user. For example;
I have the following pages, actions and forms.
firstPage.jsp firstAction.java firstForm.java
secondPage.jsp secondAction.java secondForm.java
finalPage.jsp finalAction.java finalForm.java

In the finalAction class I need to retrieve property values that were filled in
from the firstPage.jsp and the secondPage.jsp. Beside setting the scope of each
form to session in the action mapping what else do I need to do so that I may
retrieve those values?

Any suggestion?
Thank you in advance.
Kam Lung Leung

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: how to retrieve property values from previous forms/jsp pages

Posted by David Friedman <hu...@ix.netcom.com>.
Kam,

One approach is to use hidden variables to ensure all fields are in every
page.

Another approach is to have each action use the same form in "session" scope
so all fields are retained between POSTs (just remember to
getSession().removeAttribute(NAME) when you're done with it to free up
memory.

A third approach is to put each action's bean in the "session" scope similar
to the previous paragraph.  Again, remember to remove the session beans when
you're finished with them to keep your memory usage down.

I prefer the 2nd approach: one bean in session scoped shared by multiple
actions.

Regards,
David

-----Original Message-----
From: Kam Lung Leung [mailto:kleung@wlwa.com]
Sent: Monday, November 03, 2003 2:18 PM
To: struts-user@jakarta.apache.org
Subject: how to retrieve property values from previous forms/jsp pages


Hi,

I need to retrieve property values from previous pages that were inputted by
the
user. For example;
I have the following pages, actions and forms.
firstPage.jsp firstAction.java firstForm.java
secondPage.jsp secondAction.java secondForm.java
finalPage.jsp finalAction.java finalForm.java

In the finalAction class I need to retrieve property values that were filled
in
from the firstPage.jsp and the secondPage.jsp. Beside setting the scope of
each
form to session in the action mapping what else do I need to do so that I
may
retrieve those values?

Any suggestion?
Thank you in advance.
Kam Lung Leung

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org