You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bart Busschots <ba...@so-4pt.net> on 2006/08/04 00:09:38 UTC

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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Re: Validator not getting called and I can't see why

Posted by Matt Kurjanowicz <ma...@gmail.com>.
Just curios - that's the only createStudentGroupForm instance in your
struts config?

Since DynaValidatorForm extends DynaActionForm it inherits' the
DynaActionForm toString - which always just starts off with
"DynaActionForm[..." - in the action, can you log the actual class
(form.getClass().getName()) to see what the actual class is - it could
be that struts thinks you only have a DynaActionForm instead of a
DynaValidatorForm.

Cheers,
Matt
On 8/4/06, Bart Busschots <ba...@so-4pt.net> wrote:
> Hi Niall,
>
> I don't seem to be able to get log output form the validator. Maybe I'm
> doing something wrong?
>
> This is my commons-logging.properties file:
>
> org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
> org.apache.commons.logging.simplelog.defaultlog=debug
> org.apache.commons.logging.simplelog.showlogname=true
> org.apache.commons.logging.simplelog.showdatetime=true
>
> And this is my simplelog.properties file:
>
> org.apache.commons.logging.simplelog.log.org.apache.struts.validator=trace
>
> This is not producing any output from the validator at all so I set the
> default log level to debug and then I see this when I submit the form
> that is not being validated with no data at all entered (note that every
> field depends on required):
>
> [DEBUG] ModuleUtils - Get module name for path /do
> [DEBUG] ModuleUtils - Module name found: default
> [DEBUG] RequestProcessor - Processing a 'POST' for path
> '/mentor/createStudentGroupStep1'
> [DEBUG] RequestUtils -  Looking for ActionForm bean instance in scope
> 'session' under attribute key 'createStudentGroupForm'
> [DEBUG] RequestUtils -  Can recycle existing DynaActionForm instance of
> type 'createStudentGroupForm'?: true
> [DEBUG] RequestProcessor -  Storing ActionForm bean instance in scope
> 'session' under attribute key 'createStudentGroupForm'
> [DEBUG] RequestProcessor -  Populating bean properties from this request
> [DEBUG] BeanUtils -
> BeanUtils.populate(DynaActionForm[dynaClass=createStudentGroupForm,wikiText=,noStudents=,groupName=,groupType=MINORS,studentNames={}],
> {wikiText=[Ljava.lang.String;@c8d24, page=[Ljava.lang.String;@666b9,
> noStudents=[Ljava.lang.String;@4200d3,
> groupName=[Ljava.lang.String;@443251, groupType=[Ljava.lang.String;@438e8c})
> [DEBUG] ConvertUtils - Convert string '' to class 'java.lang.String'
> [DEBUG] ConvertUtils - Convert string '' to class 'java.lang.String'
> [DEBUG] ConvertUtils - Convert string '' to class 'java.lang.String'
> [DEBUG] ConvertUtils - Convert string 'MINORS' to class 'java.lang.String'
> [DEBUG] RequestProcessor -  Validating input form properties
> [DEBUG] RequestProcessor -  Looking for Action instance for class
> vtie.portal.mentor.CreateStudentGroupPrepareAction
> [DEBUG] PropertyMessageResources - getMessage(en_US,unhandledException)
> [WARN] RequestProcessor - Unhandled Exception thrown: class
> java.lang.NumberFormatException
>
> To my un-trained eye this looks like the validator is being called but
> not doing what it should, i.e. throwing a wobbler when it gets no data
> in any field. The validation for the form in validation.xml is as follows:
>
> <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>
>
> Does any of this make sense to you and can you see anything odd in the
> traces above?
>
> Thanks,
>
> Bart.
>
> Niall Pemberton wrote:
> > Try turning on logging in debug mode, should give you more info about
> > what its doing.
> >
> > Niall
> >
> > On 8/3/06, Bart Busschots <ba...@so-4pt.net> wrote:
> >> 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: 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
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Matthew Kurjanowicz
matt.kurjanowicz@gmail.com
College of Computing
GEORGIA Institute
of TECHnology

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


Re: Validator not getting called and I can't see why

Posted by Niall Pemberton <ni...@gmail.com>.
On 8/5/06, Bart Busschots <ba...@so-4pt.net> wrote:
> Hi Niall,
>
> I don't seem to be able to get log output form the validator. Maybe I'm
> doing something wrong?
>
> This is my commons-logging.properties file:
>
> org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
> org.apache.commons.logging.simplelog.defaultlog=debug
> org.apache.commons.logging.simplelog.showlogname=true
> org.apache.commons.logging.simplelog.showdatetime=true
>
> And this is my simplelog.properties file:
>
> org.apache.commons.logging.simplelog.log.org.apache.struts.validator=trace
>
> This is not producing any output from the validator at all so I set the
> default log level to debug and then I see this when I submit the form
> that is not being validated with no data at all entered (note that every
> field depends on required):
>
> [DEBUG] ModuleUtils - Get module name for path /do
> [DEBUG] ModuleUtils - Module name found: default
> [DEBUG] RequestProcessor - Processing a 'POST' for path
> '/mentor/createStudentGroupStep1'
> [DEBUG] RequestUtils -  Looking for ActionForm bean instance in scope
> 'session' under attribute key 'createStudentGroupForm'
> [DEBUG] RequestUtils -  Can recycle existing DynaActionForm instance of
> type 'createStudentGroupForm'?: true
> [DEBUG] RequestProcessor -  Storing ActionForm bean instance in scope
> 'session' under attribute key 'createStudentGroupForm'
> [DEBUG] RequestProcessor -  Populating bean properties from this request
> [DEBUG] BeanUtils -
> BeanUtils.populate(DynaActionForm[dynaClass=createStudentGroupForm,wikiText=,noStudents=,groupName=,groupType=MINORS,studentNames={}],
> {wikiText=[Ljava.lang.String;@c8d24, page=[Ljava.lang.String;@666b9,
> noStudents=[Ljava.lang.String;@4200d3,
> groupName=[Ljava.lang.String;@443251, groupType=[Ljava.lang.String;@438e8c})
> [DEBUG] ConvertUtils - Convert string '' to class 'java.lang.String'
> [DEBUG] ConvertUtils - Convert string '' to class 'java.lang.String'
> [DEBUG] ConvertUtils - Convert string '' to class 'java.lang.String'
> [DEBUG] ConvertUtils - Convert string 'MINORS' to class 'java.lang.String'
> [DEBUG] RequestProcessor -  Validating input form properties
> [DEBUG] RequestProcessor -  Looking for Action instance for class
> vtie.portal.mentor.CreateStudentGroupPrepareAction
> [DEBUG] PropertyMessageResources - getMessage(en_US,unhandledException)
> [WARN] RequestProcessor - Unhandled Exception thrown: class
> java.lang.NumberFormatException
>
> To my un-trained eye this looks like the validator is being called but
> not doing what it should, i.e. throwing a wobbler when it gets no data
> in any field. The validation for the form in validation.xml is as follows:
>
> <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>
>
> Does any of this make sense to you and can you see anything odd in the
> traces above?

Validator is throwing a wobbler like you said. You have the DEBUG
message from the RequestProcessor before it does validation - but
there should be one after saying either there were errors or that
everything was OK. You need to find out what the exception being
thrown is for - create a custom DynaValidatorForm and trap the
exception and get the cause.

The other thing that someone else pointed out is that you have used
the "page" attribute in your validation.xml, but not defined it as a
property for your DynaValidatorForm - so maybe its something to do
with that.

Anyway the root of the problem is the exception being throw - find out
what that is and it should shed a whole lot more light on the problem.

Niall


> Thanks,
>
> Bart.
>
> Niall Pemberton wrote:
> > Try turning on logging in debug mode, should give you more info about
> > what its doing.
> >
> > Niall
> >
> > On 8/3/06, Bart Busschots <ba...@so-4pt.net> wrote:
> >> 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: 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
> >
>
>
> ---------------------------------------------------------------------
> 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


Re: Validator not getting called and I can't see why

Posted by Bart Busschots <ba...@so-4pt.net>.
Hi Niall,

I don't seem to be able to get log output form the validator. Maybe I'm 
doing something wrong?

This is my commons-logging.properties file:

org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
org.apache.commons.logging.simplelog.defaultlog=debug
org.apache.commons.logging.simplelog.showlogname=true
org.apache.commons.logging.simplelog.showdatetime=true

And this is my simplelog.properties file:

org.apache.commons.logging.simplelog.log.org.apache.struts.validator=trace

This is not producing any output from the validator at all so I set the 
default log level to debug and then I see this when I submit the form 
that is not being validated with no data at all entered (note that every 
field depends on required):

[DEBUG] ModuleUtils - Get module name for path /do
[DEBUG] ModuleUtils - Module name found: default
[DEBUG] RequestProcessor - Processing a 'POST' for path 
'/mentor/createStudentGroupStep1'
[DEBUG] RequestUtils -  Looking for ActionForm bean instance in scope 
'session' under attribute key 'createStudentGroupForm'
[DEBUG] RequestUtils -  Can recycle existing DynaActionForm instance of 
type 'createStudentGroupForm'?: true
[DEBUG] RequestProcessor -  Storing ActionForm bean instance in scope 
'session' under attribute key 'createStudentGroupForm'
[DEBUG] RequestProcessor -  Populating bean properties from this request
[DEBUG] BeanUtils - 
BeanUtils.populate(DynaActionForm[dynaClass=createStudentGroupForm,wikiText=,noStudents=,groupName=,groupType=MINORS,studentNames={}], 
{wikiText=[Ljava.lang.String;@c8d24, page=[Ljava.lang.String;@666b9, 
noStudents=[Ljava.lang.String;@4200d3, 
groupName=[Ljava.lang.String;@443251, groupType=[Ljava.lang.String;@438e8c})
[DEBUG] ConvertUtils - Convert string '' to class 'java.lang.String'
[DEBUG] ConvertUtils - Convert string '' to class 'java.lang.String'
[DEBUG] ConvertUtils - Convert string '' to class 'java.lang.String'
[DEBUG] ConvertUtils - Convert string 'MINORS' to class 'java.lang.String'
[DEBUG] RequestProcessor -  Validating input form properties
[DEBUG] RequestProcessor -  Looking for Action instance for class 
vtie.portal.mentor.CreateStudentGroupPrepareAction
[DEBUG] PropertyMessageResources - getMessage(en_US,unhandledException)
[WARN] RequestProcessor - Unhandled Exception thrown: class 
java.lang.NumberFormatException

To my un-trained eye this looks like the validator is being called but 
not doing what it should, i.e. throwing a wobbler when it gets no data 
in any field. The validation for the form in validation.xml is as follows:

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

Does any of this make sense to you and can you see anything odd in the 
traces above?

Thanks,

Bart.

Niall Pemberton wrote:
> Try turning on logging in debug mode, should give you more info about
> what its doing.
>
> Niall
>
> On 8/3/06, Bart Busschots <ba...@so-4pt.net> wrote:
>> 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: 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
>


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


Re: Validator not getting called and I can't see why

Posted by Niall Pemberton <ni...@gmail.com>.
Try turning on logging in debug mode, should give you more info about
what its doing.

Niall

On 8/3/06, Bart Busschots <ba...@so-4pt.net> wrote:
> 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: 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


Re: Validator not getting called and I can't see why [resolved]

Posted by Romu <ro...@gmail.com>.
for example  :
mentor.createStudentGroup
>
> .groupName.label = the Student Group Name
>


2006/8/7, Romu <ro...@gmail.com>:
>
> U mean a javascript error ?
>
> u need to define  a message.properties file too which will define the
> error messa
>
>
> 2006/8/6, Bart Busschots < bart-lists@so-4pt.net>:
>
> > OK, I got all this figured out in the end.
> >
> > The validator was being called but because of problems with the page
> > attribute in the form the validator appears to have been receiving a
> > page value of zero and hence not validating the items on pages 1 or two
> > because neither 1 nor 2 are less that or equal to zero! When I did get
> > the validator to be called it still wasn't working right but I got that
> > fixed too.
> >
> > Anyhow, I did up a blog post about it which can be found here:
> > http://www.bartbusschots.ie/blog/?p=262
> >
> > If people thing an edited version of this would be a useful addition to
> > the Wiki work away, just credit me or link to the original blog post and
> > I'll be more than happy.
> >
> > Cheers for your help guys,
> >
> > Bart.
> >
> > Bart Busschots wrote:
> > > 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: 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
> >
> >
>

Re: Validator not getting called and I can't see why [resolved]

Posted by Bart Busschots <ba...@so-4pt.net>.
Romu wrote:
> U mean a javascript error ?
>
No, I don't use clientside validation on my forms. It's going to the 
server anyhow so I don't see the point, just an extra layer for things 
to not work in.


> u need to define  a message.properties file too which will define the 
> error
> messa
Good point, post edited.

Bart.
>
>
> 2006/8/6, Bart Busschots <ba...@so-4pt.net>:
>>
>> OK, I got all this figured out in the end.
>>
>> The validator was being called but because of problems with the page
>> attribute in the form the validator appears to have been receiving a
>> page value of zero and hence not validating the items on pages 1 or two
>> because neither 1 nor 2 are less that or equal to zero! When I did get
>> the validator to be called it still wasn't working right but I got that
>> fixed too.
>>
>> Anyhow, I did up a blog post about it which can be found here:
>> http://www.bartbusschots.ie/blog/?p=262
>>
>> If people thing an edited version of this would be a useful addition to
>> the Wiki work away, just credit me or link to the original blog post and
>> I'll be more than happy.
>>
>> Cheers for your help guys,
>>
>> Bart.
>>
>> Bart Busschots wrote:
>> > 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: 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
>>
>>
>


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


Re: Validator not getting called and I can't see why [resolved]

Posted by Romu <ro...@gmail.com>.
U mean a javascript error ?

u need to define  a message.properties file too which will define the error
messa


2006/8/6, Bart Busschots <ba...@so-4pt.net>:
>
> OK, I got all this figured out in the end.
>
> The validator was being called but because of problems with the page
> attribute in the form the validator appears to have been receiving a
> page value of zero and hence not validating the items on pages 1 or two
> because neither 1 nor 2 are less that or equal to zero! When I did get
> the validator to be called it still wasn't working right but I got that
> fixed too.
>
> Anyhow, I did up a blog post about it which can be found here:
> http://www.bartbusschots.ie/blog/?p=262
>
> If people thing an edited version of this would be a useful addition to
> the Wiki work away, just credit me or link to the original blog post and
> I'll be more than happy.
>
> Cheers for your help guys,
>
> Bart.
>
> Bart Busschots wrote:
> > 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: 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
>
>

Re: Validator not getting called and I can't see why [resolved]

Posted by Bart Busschots <ba...@so-4pt.net>.
OK, I got all this figured out in the end.

The validator was being called but because of problems with the page 
attribute in the form the validator appears to have been receiving a 
page value of zero and hence not validating the items on pages 1 or two 
because neither 1 nor 2 are less that or equal to zero! When I did get 
the validator to be called it still wasn't working right but I got that 
fixed too.

Anyhow, I did up a blog post about it which can be found here: 
http://www.bartbusschots.ie/blog/?p=262

If people thing an edited version of this would be a useful addition to 
the Wiki work away, just credit me or link to the original blog post and 
I'll be more than happy.

Cheers for your help guys,

Bart.

Bart Busschots wrote:
> 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: 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


Re: Validator not getting called and I can't see why

Posted by Matt Kurjanowicz <ma...@gmail.com>.
Do you have the property "page" being submitted with your form:
<html:hidden property="page" value="1"/>

Also, are you sure that the validation isn't working and the error
messages aren't getting displayed?  Can you send the jsp source?
-Matt

On 8/3/06, Bart Busschots <ba...@so-4pt.net> wrote:
> 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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Matthew Kurjanowicz
matt.kurjanowicz@gmail.com
College of Computing
GEORGIA Institute
of TECHnology

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