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" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Friday, February 29, 2008 9:16 AM
Subject: RE: expression validator


> --- Deepak Kumar <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to