struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arulmani V A <arulman...@yahoo.com>
Subject Struts 2 - Global Validation
Date Wed, 03 Feb 2010 20:37:23 GMT
Hi, 

How to do global validation in Struts 2 ? For example, in Struts 1, I can define all global
regular expression validations in a file called validation-regexpr.xml such as :
    <global>
        <constant>
            <constant-name>alpha</constant-name>
            <constant-value>[A-Za-z]*</constant-value>
        </constant>
    </global>

The above global regular expressions can be reused in other validation files as follows : 
            <field property="EmployeeName" depends="mask">
                <msg name="mask" key="errors.invalid" />
                <arg position="0" key="label.EmployeeName" />
                <var>
                    <var-name>mask</var-name>
                    <var-value>${alpha}</var-value>
                </var>
            </field>
Any help in this regard will be greatly appreciated.

Regards
Arul



      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message