You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rick Schumeyer <rs...@ieee.org> on 2006/12/10 15:15:20 UTC

novice validator question

Three questions about Validator to get me started:

(1) The 1.3.5 docs state:
By convention, the validators your application uses can be loaded 
through a file named "validator-rules.xml"

I've looked in the Blank and MailReader sample apps, and don't see this 
file anywhere.  Do I need it?  If not, how does the validator know about 
the default rules?

(2) In a field element, I assume the arg element refers to the messages 
in MessageResources.properties.  I also assume that the mapping from, 
say, the required rule to errors.required happens in the 
validator-rules.xml file...which I can't find.

    <field property="name" depends="required">
        <arg position="0" key="customer.name"/>
    </field>

(3) My primary struts documentation covers struts 1.1.  Should I expect 
surprises with the validator in 1.3?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: novice validator question

Posted by Paul Benedict <pb...@apache.org>.
Rick,

(1) Struts 1.3.5 contains a file which exposes the Validator functions 
to Struts. This is mostly an internal file, which is why it is provided 
for you and do not have to customize. You are probably thinking of the 
other XML files which you have to write, which describe the validations 
that belong to your form.

(2) See above. This file you must write yourself.

Paul

Rick Schumeyer wrote:
> Three questions about Validator to get me started:
> 
> (1) The 1.3.5 docs state:
> By convention, the validators your application uses can be loaded 
> through a file named "validator-rules.xml"
> 
> I've looked in the Blank and MailReader sample apps, and don't see this 
> file anywhere.  Do I need it?  If not, how does the validator know about 
> the default rules?
> 
> (2) In a field element, I assume the arg element refers to the messages 
> in MessageResources.properties.  I also assume that the mapping from, 
> say, the required rule to errors.required happens in the 
> validator-rules.xml file...which I can't find.
> 
>    <field property="name" depends="required">
>        <arg position="0" key="customer.name"/>
>    </field>
> 
> (3) My primary struts documentation covers struts 1.1.  Should I expect 
> surprises with the validator in 1.3?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org