>From: "Wendy Smoak" <[EMAIL PROTECTED]> 
>
> On 9/25/06, Gary VanMatre wrote: 
> 
> > There are several issues logged in the commons validator that required some 
> change. I think you are missing the formset/form info for your custom rule. 
> 
> Thanks, that was it. 
> 
> Can you clarify something in the Javadoc [1]? 
> 
> It says "Within the field definition, arg's are used to define the 
> parameters in order for message substitution and method argument value 
> resolution. There are two reserved name values for the arg node used 
> to define messages and parameters." 
> 
> In the second sentence, what are the two 'reserved name values'? 
> 
> (I think you might mean 'arg' and 'submittedValue'... but those are 
> 'key values'.) 
> 

No, I was trying to point to the literal value of the name attribute in the 
arg's node as having two reserved enumerations "message|parameter".

<arg position="0" name="message" ...
<arg position="0" name="parameter" ...


> I'm also not sure why three 'message' args are shown, when the 
> errors.invalid message only uses {0}. 
> 

The validator message can be overridden within the view.  By being able to 
specify multiple message parameters, you can customize your own message.
You can give all options that apply to the validation rule and let the 
developer 
choose what fits the context.

For example, the mask rule defines three message parameters.

<arg position="0" name="message" key="arg" resource="false"/>
<arg position="1" name="message" key="mask" resource="false"/>
<arg position="2" name="message" key="submittedValue" resource="false"/>

You might choose to override the default with a custom message.

<s:commonsValidator type="mask" arg="Email" 
message="/"{2}/" is not a valid value. {0} fails to validate on the expression 
\"{1}\"." ....



> [1] 
> http://shale.apache.org/shale-core/apidocs/org/apache/shale/validator/CommonsVal
>  
> idator.html 
> 
> Thanks, 
> Wendy 


Gary

Reply via email to