You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Néstor Boscán <ne...@gmail.com> on 2008/10/14 16:51:13 UTC

Is there a way for *-validate.xml to validate specific methods instead of Action Ids?

Hi

Is there a way I can create action-method-validate.xml to validate specific
methods instead of Action IDs. We have a lot of Actions with many methods
and is a real problem to configure the *-validate.xml because it will
validate all methods (except those in excludeMethods but this configuration
can get really complicated). The use of class-actionName-validate.xml is
also difficult because it means I have to create one action per method.

Regards,

Nestor

Re: Is there a way for *-validate.xml to validate specific methods instead of Action Ids?

Posted by Lukasz Lenart <lu...@googlemail.com>.
2008/10/15 Néstor Boscán <ne...@gmail.com>:
> Yes but that's my point. If I have an Action with 5 methods with 5 different
> validations I have to create 5 different action aliases just to make the
> validation framework happy, makes no sense to me.

You can try to use Visitor Validator [1] when you can validate your
Model, read also this [2] article on java.net, Visitor Field
Validation section

[1] http://struts.apache.org/2.0.11.2/docs/validation.html
[2] http://today.java.net/pub/a/today/2006/01/19/webwork-validation.html?page=2


Regards
-- 
Lukasz
http://www.lenart.org.pl/

Re: Is there a way for *-validate.xml to validate specific methods instead of Action Ids?

Posted by Sébastien Domergue <se...@c-s.fr>.
Actually, you will have te create 5 different aliases in order to map 
the method called in your struts.xml. The alias is the name of the 
action in this file.

regards

Sébastien

Néstor Boscán a écrit :
> Yes but that's my point. If I have an Action with 5 methods with 5 different
> validations I have to create 5 different action aliases just to make the
> validation framework happy, makes no sense to me.
>
> Regards,
>
> Néstor Boscán
>
> -----Mensaje original-----
> De: Sébastien Domergue [mailto:sebastien.domergue@c-s.fr] 
> Enviado el: Tuesday, October 14, 2008 10:29 AM
> Para: Struts Users Mailing List
> Asunto: Re: Is there a way for *-validate.xml to validate specific methods
> instead of Action Ids?
>
> hi,
>
> actually, you can name your validation file with the following pattern :
> <actionClass>-<actionAlias>-validation.xml
>
> where actionAlias is the name of the action used to call the actionClass.
>
> regards
>
> Sébastien
>
> Néstor Boscán a écrit :
>   
>> Hi
>>
>> Is there a way I can create action-method-validate.xml to validate 
>> specific methods instead of Action IDs. We have a lot of Actions with 
>> many methods and is a real problem to configure the *-validate.xml 
>> because it will validate all methods (except those in excludeMethods 
>> but this configuration can get really complicated). The use of 
>> class-actionName-validate.xml is also difficult because it means I have to
>>     
> create one action per method.
>   
>> Regards,
>>
>> Nestor
>>
>>   
>>     
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>   

RE: Is there a way for *-validate.xml to validate specific methods instead of Action Ids?

Posted by Néstor Boscán <ne...@gmail.com>.
Yes but that's my point. If I have an Action with 5 methods with 5 different
validations I have to create 5 different action aliases just to make the
validation framework happy, makes no sense to me.

Regards,

Néstor Boscán

-----Mensaje original-----
De: Sébastien Domergue [mailto:sebastien.domergue@c-s.fr] 
Enviado el: Tuesday, October 14, 2008 10:29 AM
Para: Struts Users Mailing List
Asunto: Re: Is there a way for *-validate.xml to validate specific methods
instead of Action Ids?

hi,

actually, you can name your validation file with the following pattern :
<actionClass>-<actionAlias>-validation.xml

where actionAlias is the name of the action used to call the actionClass.

regards

Sébastien

Néstor Boscán a écrit :
> Hi
>
> Is there a way I can create action-method-validate.xml to validate 
> specific methods instead of Action IDs. We have a lot of Actions with 
> many methods and is a real problem to configure the *-validate.xml 
> because it will validate all methods (except those in excludeMethods 
> but this configuration can get really complicated). The use of 
> class-actionName-validate.xml is also difficult because it means I have to
create one action per method.
>
> Regards,
>
> Nestor
>
>   



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


Re: Is there a way for *-validate.xml to validate specific methods instead of Action Ids?

Posted by Sébastien Domergue <se...@c-s.fr>.
hi,

actually, you can name your validation file with the following pattern :
<actionClass>-<actionAlias>-validation.xml

where actionAlias is the name of the action used to call the actionClass.

regards

Sébastien

Néstor Boscán a écrit :
> Hi
>
> Is there a way I can create action-method-validate.xml to validate specific
> methods instead of Action IDs. We have a lot of Actions with many methods
> and is a real problem to configure the *-validate.xml because it will
> validate all methods (except those in excludeMethods but this configuration
> can get really complicated). The use of class-actionName-validate.xml is
> also difficult because it means I have to create one action per method.
>
> Regards,
>
> Nestor
>
>