struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raffy_L...@ffic.com
Subject RE: Validator problem (or user problem... not sure which yet)
Date Wed, 19 Jun 2002 19:48:30 GMT

have you tried setting validate="true" in your action?

like,

action path="/createNew" parameter=""
type="com.ebind.plantsec.create.actionCreateNew" name="formNewRequest"
input="plantsec.create.new" scope="request" validate="true"><forward name
="continue"
path="plantsec.create.new" redirect="false" /><forward name="success"
path="plantsec.mainmenu" redirect="false" /></action>


or invoke the validate method inside the action's execute() method

like,

errors = ((DynaValidatorForm)form).validate(mapping,request);
        if (!errors.empty()) {
           saveErrors(request, errors);
           return new ActionForward(mapping.getInput());
        }

???




wbchmura@Ensign-BickfordInd.com on 06/19/2002 12:46:39 PM

Please respond to "Struts Users Mailing List"
      <struts-user@jakarta.apache.org>

To:   struts-user@jakarta.apache.org
cc:
Subject:  RE: Validator problem (or user problem... not sure which yet)



tried that... Still ignoring me...


-----Original Message-----
From: william.wws [mailto:william_wws@hotmail.com]
Sent: Wednesday, June 19, 2002 3:21 PM
To: struts-user
Subject: Re: Validator problem (or user problem... not sure which yet)



Try to do something like this

<form-bean name="myForm" dynamic="true"
type="org.apache.struts.validator.DynaValidatorForm">

Don't forget the dynamic="true"

William.


>From: wbchmura@Ensign-BickfordInd.com
>Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
>To: struts-user@jakarta.apache.org
>Subject: Validator problem (or user problem... not sure which yet)
>Date: Wed, 19 Jun 2002 15:23:43 -0400
>
>
>As I feared I am having trouble with the same spot I was having before:
>I have the DynaActionForm working well enough.  It passes through to
the
>action fine, and all my data appears to be there.
>
>However, when I try to do validation with it by declaring my form bean
>as org.apache.struts.validator.DynaValidatorForm or
>DynaValidatorActionForm it does absolutely nothing validation wise.  It
>cruises right through to my action...
>
>-----
>Here is what my struts-config.xml looks like:
>
><form-bean name="formNewRequest"
>type="org.apache.struts.validator.DynaValidatorActionForm">
><set-property property="dynamic" value="true" /><form-property
>name="employeeFirstName" type="java.lang.String" initial=""
>/><form-property name="employeeLastName" type="java.lang.String"
>initial="" /><form-property name="contactInfo" type="java.lang.String"
>initial="" /><form-property name="vendorCompanyName"
>type="java.lang.String" initial="" /><form-property
>name="vendorEmployeeName" type="java.lang.String" initial=""
>/><form-property name="startDate" type="java.lang.String" initial=""
>/><form-property name="endDate" type="java.lang.String" initial=""
>/><form-property name="campus" type="java.lang.String"
>initial="Simsbury" /><form-property name="accessAreas"
>type="java.lang.String" initial="" /><form-property name="notes"
>type="java.lang.String" initial="" /></form-bean>
>
><action path="/createNew" parameter=""
>type="com.ebind.plantsec.create.actionCreateNew" name="formNewRequest"
>input="plantsec.create.new" scope="request"><forward name="continue"
>path="plantsec.create.new" redirect="false" /><forward name="success"
>path="plantsec.mainmenu" redirect="false" /></action>
>
>----------------------------------------------
>
>My validator.xml looks like so:
>
>    <formset>
>    <form name="formNewRequest">
>          <field property="employeeFirstName"
>                 depends="required">
>                   <arg0
key="registrationForm.firstname.displayname"/>
>          </field>
>     </form>
>     </formset>
>
>-
>
>
>
>-----Original Message-----
>From: william.wws [mailto:william_wws@hotmail.com]
>Sent: Wednesday, June 19, 2002 1:56 PM
>To: struts-user
>Subject: Re: Validator problem (or user problem... not sure which yet)
>
>
>
>Why don't you use DynaActionForm ? I don't have problem to use the
>validate
>with DynaActionForms !
>William.
>
> >From: wbchmura@Ensign-BickfordInd.com
> >Reply-To: "Struts Users Mailing List"
<struts-user@jakarta.apache.org>
> >To: struts-user@jakarta.apache.org
> >Subject: Validator problem (or user problem... not sure which yet)
> >Date: Wed, 19 Jun 2002 13:42:49 -0400
> >
> >
> >Hiya,
> >
> >
> >I am having trouble getting validator to work under 1.1b (I never
used
> >it before).
> >
> >I have the plug in defined, I have the validator.xml set up with my
>form
> >name like so:
> >
> ><form  name="formNewRequest">
> >  <field    property="value(employeeFirstName)"
> >         depends="required">
> >                 <arg0
>key="registrationForm.firstname.displayname"/>
> ></field>
> ></form>
> >
> >Notice the property?  Can I do this?  My bean has a setValue( ) and
> >getValue( ) method that I work with.
> >
> >The result of this is nothing.  It returns back to the form page, but
> >that could be because of my normal validate routine
> >
> >The other strange thing is that although it calls my validate method
in
> >my formbean any error messages disappear off into the bit bucket...
> >
> >Should I just migrate to dynaforms?  Would that be best?
> >
> >Thanks
> >
> >Bill
> >
> >
> >--
> >To unsubscribe, e-mail:
> ><mailto:struts-user-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail:
> ><mailto:struts-user-help@jakarta.apache.org>
>
>
>
>
>_________________________________________________________________
>Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
>--
>To unsubscribe, e-mail:
><mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail:
><mailto:struts-user-help@jakarta.apache.org>
>
>
>
>--
>To unsubscribe, e-mail:
><mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail:
><mailto:struts-user-help@jakarta.apache.org>
>




_________________________________________________________________
Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp.


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <
mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <
mailto:struts-user-help@jakarta.apache.org>






**********************************************************************
Please Note:
The information in this E-mail message, and any files transmitted
with it, is confidential and may be legally privileged.  It is
intended only for the use of the individual(s) named above.  If you
are the intended recipient, be aware that your use of any confidential
or personal information may be restricted by state and federal
privacy laws.  If you, the reader of this message, are not the
intended recipient, you are hereby notified that you should not
further disseminate, distribute, or forward this E-mail message.
If you have received this E-mail in error, please notify the sender
and delete the material from any computer.  Thank you.
**********************************************************************




--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message