----- Original Message ----- From: "David Winterfeldt" <[EMAIL PROTECTED]> To: "Struts Developers List" <[EMAIL PROTECTED]> Sent: Thursday, April 18, 2002 3:33 PM Subject: Re: Struts Validator: The Role of Page No.
> > --- Jing Zhou <[EMAIL PROTECTED]> wrote: > > I am trying to normalize hundreds of screen objects > > in > > a struts related tool, so when the validator page > > number > > came into the picture, I feel I am not fully > > understand its > > implications from the perspective of business > > scenarios. > > > > Basically I think the validator just validate the > > current > > page is *enough* in most of cases for a multi-page > > application. The validator could refer to the data > > entered in the previous pages when validating the > > current page, but it does not need to re-validate > > the > > previous pages. If someone says the data from the > > current page may invalidate the data in the previous > > pages in his/her application, that could means the > > order of page sequence is incorrect in the design. > > To make a good design, the rule to follow is very > > simple: The current page is validated according > > to the data in the current page and the previous > > pages, > > but not the following pages. Could someone > > give me a contradiction here? I am probably missing > > something when considering this rule. > If the way the page number works doesn't fit your > need, you don't need to use it. In a linear > multi-page form where the Action keeps forwarding you > to the next page as each form is validated, I think > this behaviour makes sense. It is my understanding that you could treat the multi-page forms as ONE logical page. So validating everything on this logical page will make sense. The challenging constraint I have is that I have to provide an automatic procedure for non-programming business users to validate whatever properties they specify on a view model. The procedure must be completed within the phase of validation (not reaching the Action.execute() phase yet.) In order to make things simple for them, I could not let the business users to specify another action to perform page validation. A simple generic automatic procedure is in its early shape, but I havn't figure out how to connect it to your validator yet. The page number bothers me. In your early reply, the page number is optional, I am really happy with it. Thanks lot! Jing > > You could use the ValidatorActionForm if you want to > associate your validation rules with an action. Then > you would have an separate action for each form. > > "Another alternative is to use the action mapping you > are currently on by extending the ValidatorActionForm > instead of the ValidatorForm. The ValidatorActionForm > uses the action element's 'path' attribute from the > struts-config.xml which should match the form > element's name attribute in the validation.xml. Then a > separate action can be defined for each page in a > multi-page form and the validation rules can be > associated with the action and not a page number as in > the example of a multi-page form in the validator > example." > > http://home.earthlink.net/~dwinterfeldt/overview.html > > David > > > > > Another problem with the page number is when > > users skip over several pages by choosing > > certain check boxes or selections in an application, > > should the skipped pages be validated? If yes, the > > validator may have to take the burden to distinguish > > the situations where the data had been specified > > by users or skipped by users. Is that true? > > > > I hope my question is more clear this time and > > someone could offer your judgements and > > correct me if you think I am going to make > > a fundamental mistake here. > > > > Thanks, > > > > Jing > > > > > > > > > > ----- Original Message ----- > > From: "Jing Zhou" <[EMAIL PROTECTED]> > > To: "Struts Developers List" > > <[EMAIL PROTECTED]> > > Sent: Wednesday, April 17, 2002 7:55 PM > > Subject: Struts Validator: The Role of Page No. > > > > > > When looking into the validator codes, the page no. > > of a wizard > > like application is needed for validator to work. It > > looks to me > > that the validator will validate the current page > > plus all pages > > before the current one. > > > > Could someone provide some design thinking as why > > developers > > may need to validate all pages before the current > > page? > > Or this feature is a kind of 'double checking' (or > > extra checking) > > that could be turned on or off in configuration > > files? > > > > Thanks, > > Jing > > > > > > > > > > -- > > To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Tax Center - online filing with TurboTax > http://taxes.yahoo.com/ > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>