Sure you can, just follow Eric's example and subclass DynaValidatorForm.
Then change your form-bean declaration to
<form-bean name="createStudentGroupForm"
type="view.struts.forms.Page_6_Form">
        ...
</form-bean>

Adam

-----Original Message-----
From: Bart Busschots [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 04, 2006 10:41 AM
To: Struts Users Mailing List
Subject: Re: Validator not getting called and I can't see why

Hi Eric,

Thanks for the reply but I'm using a DynaValidatorForm so I don't have a
class to override things in. I would assume that DynaValidatorForm
validates correctly because I use it all over the place. It's just this
one action that's not validating and I just can't see what's different
here.

Bart.



Givler, Eric wrote:
> Can you override the validate() method inside your form and just call
super.validate(), then see what the error collection has?
> At least then you know it was called, but may not have done what you
thought it should:
>
> package view.struts.forms;
>
> import javax.servlet.http.HttpServletRequest;
>
> import org.apache.log4j.Logger;
> import org.apache.struts.action.ActionErrors;
> import org.apache.struts.action.ActionMapping;
> import org.apache.struts.validator.DynaValidatorForm;
>
> public class Page_6_Form extends DynaValidatorForm {
>    private static Logger log = Logger.getLogger(Page_6_Form.class);
>
>    public ActionErrors validate(ActionMapping mapping, 
>                                 HttpServletRequest request) {
>
>       log.info( request.getRemoteUser() + " *** validate() - Start 
> ***");
>
>       // step in here with debug   
>       ActionErrors errors = super.validate(mapping, request);
>
>       // look at results of errors object as watch on first test
>       log.info( request.getRemoteUser() + " *** validate - End,
errors= " +
>         ( errors == null ? "0" : errors.size()+"" ) + " ***");      
>
>       return ( errors );        
>    } // validate
>    
> } // Page_6_Form
>
>
> -----Original Message-----
> From: Bart Busschots [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 03, 2006 6:10 PM
> To: Struts Users Mailing List
> Subject: Validator not getting called and I can't see why
>
>
> I'm either missing something stupid (which is always possible) or I've

> managed to break the validator. I have an app that uses validator all 
> over the place and it's working fine in all my other actions but for 
> this one action it is simply not getting called.
>
> I can't see any difference between this action/form/validation and all

> the other ones that are working.
>
> This is the form:
>
>   <form-bean name="createStudentGroupForm" 
> type="org.apache.struts.validator.DynaValidatorForm">
>    <form-property name="groupName" type="java.lang.String" />
>    <form-property name="noStudents" type="java.lang.String" />
>    <form-property name="groupType" type="java.lang.String" />
>    <form-property name="wikiText" type="java.lang.String" />
>    <form-property name="studentNames" type="java.lang.String[]" />
>   </form-bean>
>
> This is the action:
>
>   <action path="/mentor/createStudentGroupStep1" 
> type="vtie.portal.mentor.CreateStudentGroupPrepareAction" 
> name="createStudentGroupForm" scope="session" validate="true" 
> input="/home/mentor/addStudentGroupForm.jsp">
>    <forward name="createAnonymous" 
> path="/do/mentor/createAnonymousStudentGroup" />
>    <forward name="getStudentNames" 
> path="/home/mentor/getStudentNamesForm.jsp" />
>    <forward name="fail" path="/home/mentor/addStudentGroupForm.jsp" />
>   </action>
>
> And this is the validation:
>
>   <form name="createStudentGroupForm">
>    <field property="groupName" page="1" depends="required, mask">
>     <var><var-name>mask</var-name><var-value>^[a-zA-Z]+[\w\
> ]*$</var-value></var>
>     <arg0 key="mentor.createStudentGroup.groupName.label"/>
>    </field>
>    <field property="noStudents" page="1" depends="required, integer">
>     <arg0 key="mentor.createStudentGroup.noStudents.label"/>
>    </field>
>    <field property="studentNames" page="2" depends="required">
>     <arg0 key="mentor.createStudentGroup.studentNames.label"/>
>    </field>
>   </form>
>
> Can anyone see something obviously wrong there?
>
> Cheers,
>
> Bart.
>
> ---------------------------------------------------------------------
> 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]
>
>   


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


-----------------------------------------
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.

Thank you. Paychex, Inc.


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

Reply via email to