struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paweł Wielgus <poulw...@gmail.com>
Subject Re: Prevent Initial Validation Struts 2
Date Fri, 24 Jul 2009 07:33:43 GMT
Hi,
You can navigate straight to my-action!input,
no validation is performed then.

Best greetings,
Paweł Wielgus.


2009/7/23 Greg Lindholm <greg.lindholm@gmail.com>:
>> I am new to Struts 2 and use annotation driven validations and they are
>> working correctly. The only issue I have is that the validations are
>> performed even upon navigating to my action for the first time.
>>
>> Ie All the fields on the web form are initially blank and also all my error
>> msgs from several @RequiredString fields are also displayed.
>>
>> Is there is simple way to prevent error msgs when the action is initially
>> navigated to?
>>
>
> If you have CRUD style actions you annotate the action methods that don't
> need validation with @SkipValidation.
>
> For example my CRUD actions might have doNew() , doCreate(), doEdit(), and
> doUpdate() methods and I will add the @SkipValidation to doNew() and
> doEdit() like this:
>
> @SkipValidation
> public String doNew(){...}
>
> public String doCreate(){...}
>
> @SkipValidation
> public String doEdit(){...}
>
> public String doUpdate(){...}
>

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


Mime
View raw message