I'm not sure I follow how validation is more flexible when using annotations
vs. xml files.

Aliases are how you tell xwork that this method is the one to be executed,
so there's a 1-to-1 mapping between aliases and methods.

File based validation is, in a sense, more flexible, because you can define
multiple aliases against a single method and specify different rules for
each of those.

If you could provide more information regarding your situation, that would
be of great insight.

Thanks,
-a



David Harland-3 wrote:
> 
> Hi Ted,
> 
> It appears that if you use annotations you have more flexibilty than
> with using xml. Would it not be possible to add the abililty to specify
> validation files for each method without having to create aliases for
> every single method. We have actions with quite a high number of methods
> each wanting different validation. This can get messy. 
> 
> 
> Regards
> 
> David 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
> Ted Husted
> Sent: 18 September 2007 11:12
> To: Struts Users Mailing List
> Subject: Re: S2 : Validation per Action method - ideas?
> 
>  * http://struts.apache.org/2.x/docs/validation.html
> 
> It's under "Defining Validation Rules" at 2. The term "alias" is used to
> refer to the action method.
> 
> So if there's an actions.Register.java class with "insert" and "update"
> action methods, then there might be XML docs like
> 
> /java/actions/Register-insert-validations.xml
> /java/actions/Register-update-validations.xml
> 
> One would only file for the insert method and the other only for the
> update method.
> 
> The framework makes the association automatically, based on the naming
> convention, so there's nothing else to configure.
> 
> In WebWork in Action, it's at page 353-354, under "Validation under
> different contexts".
> 
> HTH, Ted
> <http://www.husted.com/ted/blog/>
> 
> 
> On 9/18/07, David Harland <[EMAIL PROTECTED]> wrote:
>> Can someone please point me to the documentation that shows you how to
> 
>> configure validation per action method using the validation xml files?
>> Or is this not possible?
>>
>> -----Original Message-----
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of 
>> Ted Husted
>> Sent: 18 September 2007 10:27
>> To: Struts Users Mailing List
>> Cc: [EMAIL PROTECTED]
>> Subject: Re: S2 : Validation per Action method - ideas?
>>
>> I opened
>>
>>  * https://issues.apache.org/struts/browse/WW-2191
>>
>> for this, and noted the setting in the Validators documentation.
>>
>> Thanks for pointing this out, Veronica!
>>
>> -Ted.
>>
>> On 8/10/07, Veronica Iturrioz <[EMAIL PROTECTED]> wrote:
>> > You must to set the property validateAnnotatedMethodOnly=true, and 
>> > the
>> validation occurs only for the correct methods.
>> >
>> > <interceptor-ref name="validation">
>> >     true
>> >     input,back,cancel,browse
>> > </interceptor-ref>
>> >
>> > but this is ok for server validation, not for client validation.
>> > Anybody know how to resolve that for client validations?
>> >
>> >
>> > Veronica.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> - ------
> ML {UFI}
> 
> ______________________________________________________________________
> Ufi Limited 
> Registered in England No.  3980770 
> Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 
> 
> learndirect Solutions Ltd 
> Registered in England No. 5081669 
> Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 
> 
> UFI Charitable Trust 
> Registered in England No.  3658378 
> Registered Charity No.  1081028 
> Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 
> 
> This email has been scanned by the MessageLabs Email Security System.
> 
> ______________________________________________________________________
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/S2-%3A-Validation-per-Action-method---ideas--tf4242670.html#a12758403
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to