struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: expression validator
Date Fri, 29 Feb 2008 14:53:31 GMT
declare the field validator such as the field-name declared in validators in
FieldValidatorsExampleAction-submitClientSideValidationExample-validation.xm
l
<validators>
  <field name="requiredStringValidatorField">
    <field-validator type="requiredstring">
      <param name="trim">true</param>
            <message key="i18n.nothing.here"><![CDATA[ required and must be
string ]]></message>
    </field-validator>
  </field>

in the jsp setup a textfield which uses the preconfigured
requiredStringValidatorField as described in this example from
/validation/clientSideValidationExample.jsp
           <s:textfield label="Required String Validator Field"
name="requiredStringValidatorField" />

place the returned field error string into s:fielderror with param specified
as the name of the validator item described here
        <h3>Field Error due to 'Required String Validator Field' Will Appear
Here</h3>
        <s:fielderror>
            <s:param value="%{'requiredStringValidatorField'}" />
        </s:fielderror>
        <hr/>

Make sense?
M--


From: "Dave Newton" <newton.dave@yahoo.com>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Friday, February 29, 2008 9:16 AM
Subject: RE: expression validator


> --- Deepak Kumar <deepak123@roseindia.net> wrote:
> > Here is very good example with running source code.
> >
>
http://www.roseindia.net/struts/struts2/struts-2-client-side-validation-exam
ple.shtml
>
> Hmm, that doesn't seem to do client-side expression validation either,
unless
> I missed it. Perhaps you can point it out.
>
> Dave
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message