struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mick.Knut...@wellsfargo.com
Subject RE: validator.xml usage
Date Tue, 01 Jun 2004 20:55:30 GMT
OK, Here is the lot then of what I have already configured. Note that
nothing happends though when I run it. So when I go to productSelection.do
and do not select anything, I should get an error. I do not get any error.

validation.xml
==============
        <!--
        This is the validator for the prouct selection page.
        -->
        <form name="productSelectionForm">
            <field  property="businessLineSelected"
                    depends="required"
            >
                <arg0 key="form.businessLineSelected"/>
            </field>
        </form>


productSelection.jsp
====================
...
<html:form action="productSelection" method="post">
...
            <html:checkbox property="businessLineSelected" />
...
            <html:submit property="action"><bean:message
key="button.continue" bundle="BUTTONS_KEY" /></html:submit>
...





struts-config.xml
=================
        <form-bean name="productSelectionForm"
 
type="org.apache.struts.validator.DynaValidatorActionForm">
            <form-property name="businessLineSelected"
type="java.lang.String" />
            <form-property name="businessCardSelected"
type="java.lang.String" />
            <form-property name="businessSecuredCardSelected"
type="java.lang.String" />
            <form-property name="equipmentExpressSelected"
type="java.lang.String" />
            <form-property name="action" type="java.lang.String" />
         </form-bean>

        <action path="/productSelection"
                input=".productSelection"
                name="productSelectionForm"
                parameter="action"
                scope="request"
 
type="com.wf.bd.ice.creditapplication.CreditApplicationActions"
                validate="true"
        >
          <forward name="error" path=".productSelection" redirect="true" />
        	<forward name="continue" path=".business" redirect="true" />
          <!-- Start nav fwds -->
          <forward name="productSelection" path=".productSelection"
redirect="true" />
          <forward name="conclude" path=".acceptanceAgreement"
redirect="true" />
        </action>


    <controller
        contentType="text/html;charset=UTF-8"
        debug = "9"
        locale = "true"
        nocache = "true"
        processorClass = "org.apache.struts.tiles.TilesRequestProcessor"/>


    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
        <set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
    </plug-in>














-----Original Message-----
From: Rodrigo Oliveira [mailto:rodrigo.struts@icorp.com.br]
Sent: Tuesday, June 01, 2004 1:31 PM
To: Struts Users Mailing List
Subject: Re: validator.xml usage


That is true! if u specify that in the struts-config.xml!!! :)

Rodrigo Oliveira
rodrigo.struts@icorp.com.br


----- Original Message ----- 
From: "gads zooks" <gads_zooks@yahoo.com>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Tuesday, June 01, 2004 5:32 PM
Subject: Re: validator.xml usage


> that is true....if u want to use server side validation you can specify
that in the
> struts-config.html
> something like this
>
> <action path="/Action"
>             name="FormToBeValidated"
>             validate="true"                          <----------- set true
here
>             parameter="function"
>             input="somepage.jsp"   <--- goes to this page if validation
fails
> />
>
> if you want to use javascript too....with the same setup (validation.xml,
validator-rules.xml) u can add the <html:javascript/> tag to your jsp and it
will show u the errors....there are also <html:messages />  , u can check
out the info at husted.com/struts site
>
> hope this helps
>
> amit
>
>
> Rodrigo Oliveira <rodrigo.struts@icorp.com.br> wrote:
> The validation.xml you put the rules for client and server validation. The
> struts validator validate your forms based on same validation rules.
>
> []´s
>
> Rodrigo Oliveira
> rodrigo.struts@icorp.com.br
>
>
> ----- Original Message ----- 
> From:
> To:
> Sent: Tuesday, June 01, 2004 5:15 PM
> Subject: validator.xml usage
>
>
> > Is the validator.xml just for client-side validation? Or also for
> > server-side validation
> >
> >
> > ---
> > > Thanks...
> > > Mick Knutson
> > >
> > > 525 Market Street, SF, CA 94103
> > > (415) 222-1020
> > > Mick.Knutson@WellsFargo.com
> > > MAC A0103-223
> > ---
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
>
> ---------------------------------
> Do you Yahoo!?
> Friends.  Fun. Try the all-new Yahoo! Messenger


---------------------------------------------------------------------
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