dcsimg
Multi page form submission using struts
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Abhay_Shukla
Posted On:   Thursday, September 16, 2004 10:26 AM

I have 2 pages for user registration. After processing first page, I copy the form field values from user form to the user object using BeanUtils.copyProperties method and stored the "User" object into session. In the second page, after submission, in the Action class, I retrieve the User object from session and use it as destination object in the BeanUtils.copyProperties method to copy the remaining field value from the second user form object. However, after copying the properties from 2nd form object into the User object, the field values of the 1st form set into the User object are set to null. How can I prevent this from happening ?    More>>

I have 2 pages for user registration. After processing first page, I copy the form field values from user form to the user object using BeanUtils.copyProperties method and stored the "User" object into session.


In the second page, after submission, in the Action class,
I retrieve the User object from session and use it as destination object in the BeanUtils.copyProperties method to copy the remaining field value from the second user form object.


However, after copying the properties from 2nd form object into the User object, the field values of the 1st form set into the User object are set to null. How can I prevent this from happening ?

   <<Less

Re: Multi page form submission using struts

Posted By:   John_Hughes  
Posted On:   Thursday, September 30, 2004 07:25 AM

Is your action mapping, what is the scope attribute set to? You may need to set it to scope="session". This way the form data will be passed in the session so that the data from the first page is still there when you submit the second page.



Otherwise, the values from the first page will be lost because the actionform gets recreated.



Another option is to set the scope="request" & use tags in the 2nd page to hold the values from the first page. Then when the 2nd page gets submitted, you will have the values from boths forms in the actionform when you copy the data over.

Re: Multi page form submission using struts

Posted By:   Anonymous  
Posted On:   Friday, September 17, 2004 02:20 AM

Abhay, i saw the same requirement which is answered in this forum. Check it out, maybe the question is not same but the answer will suits for u r question. I hope u r aware of it but soory to remember you.
About | Sitemap | Contact