Hi Michael,
Thanks for the options you specified for handling this.
After going thru the suggested options, I think the 2nd option is better.
This is because, since it is a wizrd, so there is back and next buttons to
correct the data in different JSPs before saving.
If we need to handle this using child-mother beans then we need to keep child
beans also in the session scope.
This is because each child bean is associated with one form so to get the
entered data after forwarding 2-3 pages , if we again want to come back to the
1'st page, data should be preserved.
Although, we can do it by copying mother bean properties back in the child
bean..
What say?
- Sandeep
"Michael Mok" <[EMAIL PROTECTED]> on 06/12/2001 03:48:01 PM
Please respond to [EMAIL PROTECTED]; Please respond to
[EMAIL PROTECTED]
To: "'suhas'" <[EMAIL PROTECTED]>
cc: [EMAIL PROTECTED] (bcc: Sandeep Yawale/LTITLPUN)
Subject: RE: Handling Multipart forms (sort of Wizard)
Hi Suhas
Good question. I missed out some steps for the second option.
You will need to create three form actions to process each of the form
beans. The "mother" bean is stored in the session and is accessed and
updated in each action. Hence at the end of the logical process, the
"mother" bean has all the values for your 3 forms.
Hope it makes sense.
Regards
Michael Mok
www.webappcabaret.com/normad
-----Original Message-----
From: suhas [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 12 June 2001 16:13
To: [EMAIL PROTECTED]
Subject: Re: Handling Multipart forms (sort of Wizard)
In the below 2nd option - what is the need of the "mother" bean when u
already have separate beans for each jsp
Suhas
----- Original Message -----
From: Michael Mok <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 12, 2001 8:51 AM
Subject: RE: Handling Multipart forms (sort of Wizard)
> Sandeep
>
> Let me try. See if the solution proposed makes sense as the techniques
were
> discussed before.
>
> 1) Include a "PageNumber" attribute into your Form bean. In your JSP,
store
> the PageNumber as a hidden attribute. In your form.validate() method,
> determine which page is passed then validate the appropriate fields. For
> this to work, you will need maintain your form bean in the session object
> (ie set the scope in your struts-config.xml file).
>
> 2) Create three form beans (ie one for each JSP) and create a "mother"
bean
> that has all the attributes of the three form beans. In this case, each
form
> beans can perform its validate method() and the form action class can copy
> each form properties to the "mother" bean using PropertyUtil.copyProperty
> method. Note you will need to store the "mother" bean into the session
> object.
>
> Regards
>
> Michael Mok
> www.webappcabaret.com/normad
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 12 June 2001 15:32
> To: [EMAIL PROTECTED]
> Subject: Handling Multipart forms (sort of Wizard)
>
>
>
>
>
> Hello All,
>
> I am using mulipart forms for adding an employee information.
> In this I have 3 forms namely, emplEducation, emplExperience, emplGeneral
in
> separate JSPs.
> In this case, I am using only one form bean for all these JSPs and only
one
> action class.
>
> My problem is how to validate the Form bean after each page submission:
> --------------------------------------------------------------------------
--
> --------------------------------
>
> I know the validation can be done in the form bean using validate() method
> or in
> the action class
>
> But, if user filled emplEducation form and press "Next", to go to
> emplExperience,
> how do I validate only those form bean fields related to emplEducation and
> not
> the others till they are entered by user??
> Is there any straight forward strategy for handling this??
>
> - Sandeep
>
>
>
>
>
>
>
>
>