struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Jardin" <jeremy.jar...@gmail.com>
Subject Re: pb using validator it does not work !
Date Fri, 21 Jul 2006 08:29:03 GMT
Hi,

I'm trying with another action path in my validation.xml file, even if I'm
quite doubting..

So, my validator-rules.xml file is the default one.. with basics validators
tag.

By the way, my struts-config file :

<form-beans>
        <form-bean name="startSubscriptionForm" type="
sapinscription.form.StartSubscriptionForm"/>

    </form-beans>

  <!-- ========== Action Mapping Definitions ==============================
-->
  <action-mappings>

    <action    path      = "/StartSubscription"
               type      = "sapinscription.action.StartSubscriptionAction"
               name      = "startSubscriptionForm"
               scope     = "session"
               validate  = "true"
               input     = "/jsp/inscriptionForm.jsp"
      >
        <forward name="subscribingPage" path="/jsp/inscriptionForm.jsp" />
     </action>


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



It still does not work.
I'm currently trying adding a new action path..
On 7/20/06, Martin Gainty <mgainty@hotmail.com> wrote:
>
> Hello Jeremy and Doctor Yee-
>
> -we need to see your validator-rules.xml
> -need to see your Form declaration in struts-config.xml specifically
> <form-beans>  <form-bean
> -the validation.xml should have a minimum 2 differing action paths as
> provided in the example located here
> http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html
>
> HTH
> Martin --
> *********************************************************************
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed.  If you have received this email message in error, please
> notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy.  Thank you.
>
>
>
> ----- Original Message -----
> From: "Yee, Richard K CTR DMDC" <Richard.Yee.ctr@osd.pentagon.mil>
> To: "'Struts Users Mailing List'" <user@struts.apache.org>
> Sent: Thursday, July 20, 2006 9:14 AM
> Subject: RE: pb using validator it does not work !
>
>
> > What class is your sapinscription.form.StartSubscriptionForm extending?
> >
> > -Richard
> >
> >
> > -----Original Message-----
> > From: Jeremy Jardin [mailto:jeremy.jardin@gmail.com]
> > Sent: Thursday, July 20, 2006 3:05 AM
> > To: user@struts.apache.org
> > Subject: pb using validator it does not work !
> >
> > Hi,
> >
> > I'm trying to use validator plugin in my application, and it does not
> work
> > at all !
> >
> > First, I've just add <html:errors/> in my jsp.
> >
> > I've written a basic validation.xml file like this :
> > <form name="StartSubscriptionForm">
> >    <field property="name" depends="required">
> >        <arg0 key="inscription.nom"/>
> >    </field>
> > </form>
> >
> > Then, I've also a classic validation-rules.xml file, with usefull rules.
> > Thoses files are un my WEB-INF directory.
> >
> > I added in my struts-config.xml fil those lines :
> >
> >   <form-beans>
> >  <form-bean name="StartSubscriptionForm" type="
> > sapinscription.form.StartSubscriptionForm"/>
> >
> >    </form-beans>
> >
> >  <!-- ========== Action Mapping Definitions
> ==============================
> > -->
> >  <action-mappings>
> >
> >    <action    path      = "/StartSubscription"
> >               type      = "sapinscription.action.StartSubscriptionAction
> "
> >               name      = "StartSubscriptionForm"
> >               scope     = "session"
> >               validate  = "true"
> >               input     = "/jsp/inscriptionForm.jsp"
> >      >
> >        <forward name="subscribingPage" path="/jsp/inscriptionForm.jsp"
> />
> >     </action>
> >
> >    </action-mappings>
> >
> >  <message-resources null="false" parameter="conf.WebMessages"/>
> >
> > <!-- ============== Validator plugin
> > ======================================-->
> >
> >  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
> >    <set-property
> >        property="/StartSubscription"
> >        value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
> >  </plug-in>
> >
> >
> > It seems to be all right.. but when I submit my form, Action class
> runs.. as
> > if validation were ok.. even if I do not fill "name" field in my form?
> >
> > I guess there's something wrong.. but I don't know where ?
> >
> > Help please !
> >
> > --
> > ~ jebmail ~
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >




-- 
~ jebmail ~

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message