comments.

>----- Original Message -----
>From: "Giri Alwar" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Date: Wed, 15 Jan 2003 13:40:33 -0600
>Subject: Re: questions about struts validator
>
>
>See my comments below.
>
>----- Original Message -----
>From: <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, January 15, 2003 11:40 AM
>Subject: questions about struts validator
>
>
>> Hello -
>>
>> After reading the struts validator documentation, I had some
>> questions about it and was wondering if anyone knows the answer
>> off the top of their head...
>>
>> Here are some questions:
>>
>> 1. Is there documentation on what <var-name>'s are available for
>> the standard Validators (the ones that came with the Struts1.1b3
>> webapp, in validate-rules.xml)? Otherwise... I can read the
>> javaScript.... and scan for it I guess.
>>
>I haven't found one yet but here is a list of variables for the built-in
>validation rules (in the <rule name>:<variable name> format):
>required : no variable
>minlength : 'minlength' variable
>maxlength: 'maxlength' variable
>range : 'min' and 'max' variables (both required)
>byte, short, int, long, float, double: no variable
>date: either 'datePatternStrict' or 'datePattern' variable (one of them
>required)
>creditCard: no variable
>email: no variable
>mask: 'mask' variable
>
>> 2. If the form bean and the associated action mapping both has
>> <form> element defined, how does the validator run?  Is it combined,
>> i.e. validate via action mapping rule then form rules..? or only
>> the last defined gets validated? or?
>>
>Not sure what you mean here. The way to associate a form bean with an action
>mapping is through the "name" attribute in the <action> element.

This is the scenario that I was trying to figure out.
Suppose in the struts config file I've defined a form bean name "logonForm"
and an action named "/logon" which uses "logonForm". And suppose that
in validate.xml I've defined 
  <formset>
    <form name="logon">
       ... 
    </form>
    <form name="logonForm">
       ...
    </form>
  </formset>

When the user clicks on a button that triggers a form submit 
via the logon action...  What validation takes place?

Maybe my question should be:  When does validation for form bean
gets triggered?  Is it any time that an action uses it or?


>> 3. How are duplicated forms of the same name handled? that is, does
>> the last one found takes precedence?
>>
>First of all, this is not recommended - all form beans should be assigned a
>unique logical name. That said, the implementation uses a HashMap to store
>form beans. Hence, the last one wins.

Does this apply to something like this as well?
<formset>
   <form name="duplicateValidation">
     ...
   </form>
   <form name="duplicateValidation">
     ...
   </form>
</formset>

Thanks!

Ying




__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

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

Reply via email to