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
>
>
>
>
>
>
>
>
>

Reply via email to