Passing form bean from one action to another
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rick_Robinson
Posted On:   Thursday, April 4, 2002 12:28 PM

I've seen a few postings related to having to put a form bean into session scope under certain scenarios, but I'm not sure I get it. I have a simple action where I fill in a form (minus two fields) and submit. I take the data entered from the form and determine values for the two missing fields and then forward to the next action which displays the data from the form, including the two fields just set (the "view result" page). Seems simple enough, but the result page only contains the data from original form?! I tried putting the form into session scope in the struts-config file, but no dice. What I am doing wrong - it must be simple. As an aside, it seems to me that for this case I should not need to use session scope, but a   More>>

I've seen a few postings related to having to put a form bean into session scope under certain scenarios, but I'm not sure I get it.

I have a simple action where I fill in a form (minus two fields) and submit. I take the data entered from the form and determine values for the two missing fields and then forward to the next action which displays the data from the form, including the two fields just set (the "view result" page). Seems simple enough, but the result page only contains the data from original form?! I tried putting the form into session scope in the struts-config file, but no dice.

What I am doing wrong - it must be simple. As an aside, it seems to me that for this case I should not need to use session scope, but again, I may be missing something.

tia,
R

   <<Less

Re: Passing form bean from one action to another

Posted By:   frank_cunningham  
Posted On:   Thursday, April 11, 2002 11:49 AM

Why don't you post your struts-config.xml and your the action class where you populate the two other fields. Then we'll probably be able to help you. If you are setting the two additional fields, then most like you are not type-casting the form parameter in the process method of the action class and then using the set methods on that object.

If you are not using session scope in the struts-config.xml, then to get the data back you would have to do something like request.setAttribute(,

About | Sitemap | Contact