You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Winterfeldt <dw...@yahoo.com> on 2002/04/02 20:43:16 UTC

Re: Validator within Struts 1.1

Are you still using the your old validator definitions
in the validations.xml?  It would be good to switch to
using conf/share/validator-rules.xml.  You can either
cut and paste them into the top of your old file or
leave them separate and erase the old ones.  

for beta:
<plug-in
className="org.apache.struts.validator.ValidatorPlugIn"
   <set-property property="pathname"
value="/WEB-INF/validator-rules.xml"/>
   <set-property property="pathname"
value="/WEB-INF/validation.xml"/>
</plug-in>

as of nightly build from a one night ago (comma
delimitted):
<plug-in
className="org.apache.struts.validator.ValidatorPlugIn"
   <set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>

You would also need the Commons Validator jar when
using the new classes.  Also, are you extending
org.apache.struts.validator.ValidatorForm and not the
old one?

Also as of last night the Validator is using Jakarta
ORO instead of Jakarta Regexp.  I think it might have
broken the nightly build last night, but I'm sure it
will be fixed soon.

David

--- "Barthel Volker, HH" <Vo...@FJA.com>
wrote:
> Hi David,
> 
> We tried your great validation framework with Struts
> 1.0 and it worked very
> well. Now we switched to Struts 1.1 and configured
> the necessary .xml files
> to work with the Validator-Plugin instead of the
> ValidatorServlet. Our
> application still works, but unfortunatly the
> validator mechanism does not
> work anymore. It seems, that the form is just not
> getting validated - at
> least, not correctly. I would really appreciate We
> also tried it with a
> totally new Form, which did not exist in the Struts
> 1.0 version - without
> success. 
> 
> To follow our setup, here are the major steps we
> made of using the Validator
> built in Struts1.1:
> - adding the following lines to struts-config.xml :
>   <plug-in
>
className="org.apache.struts.validator.ValidatorPlugIn">
>     <set-property property="pathname"
> value="/WEB-INF/validation.xml"/>
>   </plug-in>
> - adding the validation.xml to the WEB-INF directory
> of our application,
> which contains these lines:
> <form-validation>
>   <formset>      
>     <form name="logonForm">
>       <field property="user"
> depends="required,minlength">
>            <arg0
> key="anEntryWhichExistsInOurResourceFile"/>
>            <arg1 name="minlength"
> key="${var:minlength}" resource="false"/>
>           <var>
>              <var-name>minlength</var-name>
>              <var-value>5</var-value>
>            </var>
>          </field>
>       </form>
>    </formset>   
> </form-validation>
> - extending the LogonForm-Bean from ValidatorForm
> instead in ActionForm and
> deleting the validate-Method in it
> 
> We did not change any jsp-files. The struts-config
> file already contained
> these lines:
>     <form-bean name="logonForm" 
> type="outPackagePath.logon.LogonForm"/>
> and
>     <action path="/logon"
>             type="ourPackagePath.logon.LogonAction"
>             name="logonForm"
>             scope="request"
>             validate="true"
>             input="/jsp/login.jsp">
>             <forward name="success"
> path="/jsp/start.jsp"/>
>             <forward name="error"  
> path="/jsp/login.jsp"/>
>     </action>
> 
> In the login.jsp is a html:input-field defined,
> where the properties name is
> "user".
> When we enter either nothing or strings less than 5
> characters long, the
> application forwards to "success" instead if the
> same page (now with an
> Error message) again. We have no clue what this
> could cause.
> May be you have an idea how to help us. Thanks so
> much! I hope, we do not
> bother you much with this kind of question, but we
> really would like to use
> the validator in our application.
> 
> Regards,
> Volker Barthel
> 
> Volker Barthel, FJA GmbH, ++49-40-236005-49
> S�derstra�e 77, D-20097 Hamburg,
> volker.barthel@fja.com
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://http://taxes.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>