Hi Ted,

Thank you for your time in helping me out. After your email message I 
take a hard look at the jsp file and can not find what was wrong with it.
The secondPage.jsp is almost the same as the firstPage.jsp. When
I move all the code from the secondPage.jsp to the firstPage.jsp the 
validation process went fine. All fields are validated by the validator.
I have given up the hope to create a multipage form for now. And by the way 
I have purchased the Struts In Actions book along with other three books 
on the same subject. But there was not must information on multipage form. 
Do you have any suggestion on book that I may find some complete example 
on multi page form. To answers your your question about why do I reset all 
input fields to its original state when the getPage() is equal to 2 is that 
I only have two pages,firstPage.jsp and secondPage.jsp, each page would set the
page number to "0" and "1" correspondingly. I set the page to 2 in the action
class when the secondPage.jsp was executed. Then I call the form's reset method
to clear all the fields before the control goes back to the firstPage.jsp. I
guest you are right about removing the form bean should be good enough to remove
all attributes in form for both pages.

Thank again.

Kam Lung Leung
On Fri, 24 Oct 2003 17:19:03 -0400, Ted Husted wrote:

> 
> Kam Lung Leung wrote:
>  >     Why don't I get a pop up dialog box with error messages?
>  >     Why the secondPage.jsp did not get executed when a validation
>  > error occurred?
>  >     Why do I get a blank screen?
> 
> Are you sure that it's blank? Sometimes the page doesn't render because 
> of errors in the HTML, which might only be exposed when the page is 
> trying to display error messages.
> 
> I'm not sure why you would reset everything if getPage() is equal to 2. 
> The usual approach is to allow the properties to accumulate, until the 
> end of the workflow, and then dispose of the (session-scoped ActionForm 
> altogether. Generally, the only thing you ever need to reset is a 
> checkbox to false on a session-scope ActionForm.
> 
> -Ted.
> 
> 
> > Hi,
> > 
> >     I have been looking at this problem for the last four days and can't
figure
> > out. I have an application that required workflow form. I created a
> > CreateUserAccountAction class that extends the DispatchAction and a form
> > MultiCreateUserAccountForm that extends the ValidatorForm.  The reset method
of
> > the MultiCreateUserAccountForm clears all attributes under the current session
> > when the getPage() is equal to 2. The CreateUserAccountAction has two methods
> > that are similar to the execute method that are named
createUserAccountActionOne
> > and createUserAccountActionTwo. I got this concept out of chapter 12 of the
book
> > Profession Jakarta Struts by James Goodwill and Richard Hightower.
> > 
> > ***********************     Here are the symptoms  **********************
> >     If there is a required field that is missing (leaved out) or does not
> fulfill
> > the validation rule on the firstPage.jsp when the submit button is pressed. A
> new
> > dialog box popped up on the screen with the validation message(s) from the
> > resource property file. When all fields are validated the control is forwarded
> to
> > the secondPage.jsp.
> > 
> >     If there is a required field that is missing (leaved out) or does not
> fulfill
> > the validation rule on the secondPage.jsp when the submit button is pressed. A
> > blank page is showed up on the window without a new dialog box shows up on the
> > screen. The server.log indicates an error occurred and the control returns to
> the
> > same page (secondPage.jsp). To fixing this problem, I pressed the back page
> > button of the browser and correctly filled in all missing fields or making
sure
> > the input is conforming to the validation rule. When all fields on the second
> > page are filled in correctly according to the validation rules then the
control
> > is correctly forwarded back to the firstPage.jsp.
> > 
> > **************  My questions************************
> > 
> > 
> > Any suggestion and how to fix this problem is deeply appriciated.
> > 
> > 
> > Kam Lung Leung 
> > 
> > 
> > 
> > 
> > *** *******        More detail on how the jsp was set up      ******
> >     The createUserAccountActionOne method calls the
> > MultiCreateUserAccountForm.validate() method to validate the user input fields
> of
> > the firstPage.jsp. Second, it calls the setPage() method with  "1" as its
input
> > parameter. Finally, it calls the
> MultiCreateUserAccountForm.setMethodToDispatch()
> > with "createUserAccountActionTwo" as the input parameter.
> >  
> >     The createUserAccountActionTwo method calls the
> > MultiCreateUserAccountForm.validate() method to validate the user input fields
> of
> > the secondPage.jsp. Secondly, it remove the obsolete form bean with
> > session.removeAttribute(mapping.getAttribute()). Thirdly, it calls the
setPage()
> > method with  "2" as its input parameter. Finally, it calls the reset() method
to
> > clear all attributes under the current session.
> > 
> > ****** This are action mapping ***********
> > <action
> >             path="/multiCreateUserAccountFirstSubmit"
> >             type="com.wlwa.CreateUserAccountAction"
> >             name="multiCreateUserAccountForm"
> >             scope="session"
> >             validate="true"
> >             parameter="methodToDispatch"
> >             input="/CreateUserAccountLink.jsp">
> >          <forward name="success" path="/CreateUserAccountSecondLink.jsp" />
> >     </action>
> > 
> >     <action
> >             path="/multiCreateUserAccountSecondSubmit"
> >             type="com.wlwa.CreateUserAccountAction"
> >             name="multiCreateUserAccountForm"
> >             scope="session"
> >             validate="true"
> >             parameter="methodToDispatch"
> >             input="/CreateUserAccountSecondLink.jsp">
> >          <forward name="success" path="/CreateUserAccountLink.jsp"   />
> >     </action>
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> -- 
> Ted Husted,
>    Junit in Action  - <http://www.manning.com/massol/>,
>    Struts in Action - <http://husted.com/struts/book.html>,
>    JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to