struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Stubbs <antony.stu...@gmail.com>
Subject Re: Validation Annotations
Date Mon, 09 Apr 2007 10:59:15 GMT

I have the same issue. atm I send everything to !input which is by default
excluded from validation.

But try looking at something like this in your struts.xml:
<interceptor-ref name="crudStack">
                <param name="validation.excludeMethods">edit,create</param>
</interceptor-ref> 

I haven't tried it yet, not quite sure how it works.
You can see here that by default, input, back and cancel are excluded from
validation. (this comes from struts-default.xml):
                <interceptor-ref name="validation">
                    <param name="excludeMethods">input,back,cancel</param>
                </interceptor-ref>



André Faria-3 wrote:
> 
> I have the following problem: 
> 
> The methods execute() and list()  must not be validated by the save 
> method rule...  I have differentes validation rules for each method, but 
> when I call the action, the interceptor tries to validate the input 
> before call execute method.  How can I resolve this?
> 
> 
> @Validation
> public class PersonAction {
>    
>     public void execute();
> 
>     public void list();
> 
>     @Validations(requiredFields = { @RequiredFieldValidator(fieldName = 
> "person.name", message = "Fill the name field.") })
>     public void save(){}
> 
> }
> 
> André Faria escreveu:
>> Is possible to use the validation annotations like  
>> @RequiredFieldValidator only for a method of the Action class?
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Validation-Annotations-tf2939610.html#a9900700
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message