struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alireza Fattahi <afatt...@yahoo.com>
Subject Re: Global Validation
Date Thu, 11 Jul 2013 10:05:15 GMT
Hi,

Well I mean is there a way which I can tell the validation frame work that all "required string" 
validations should display this message 
<message> The ${TheFiledWhichFailed} must be a string </meesage>
And then I define:
<validator type="requiredstring"> 
    <param name="fieldName">Username</param> 
</validator> 
<validator type="required"> 
    <param name="fieldName">Address</param> 
</validator> 

So when the validation fails it generates: 
The username must be string.
The address must be string.
.....


Or should I do it:
<validator type="requiredstring"> 
    <param name="fieldName">Username</param> 
    <message>Username must be string.</message> 
</validator> 

<validator type="required"> 
    <param name="fieldName">Address</param> 
    <message>Address must be string.</message> 
</validator> 

 

~Regards,
~~Alireza Fattahi


________________________________
 From: Lukasz Lenart <lukaszlenart@apache.org>
To: Struts Users Mailing List <user@struts.apache.org> 
Sent: Wednesday, 10 July 2013, 16:47
Subject: Re: Global Validation
 

2013/7/10 Alireza Fattahi <afattahi@yahoo.com>:
> Hi,
>
> Are there Global Validation  in struts 2 ?!

What you mean by that? Validations which affects each and every
action? If so, no.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message