You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nathan Maves <Na...@Sun.COM> on 2004/04/14 23:33:32 UTC
Strange problem with the validator.
Anyone know why the error message does not show the maxlength argument.
# Purpose can not be greater than characters.
# Description can not be greater than characters.
notice it places the first argument (name of the field) but not the max
length.
from the validation.xml
<field property="purpose" depends="required, maxlength">
<arg0 key="request.purpose" />
<arg1 name="maxlength" key="${var:maxlength}" />
<var>
<var-name>maxlength</var-name>
<var-value>2000</var-value>
</var>
</field>
<form-bean name="requestForm"
type="org.apache.struts.validator.DynaValidatorActionForm">
<form-property name="name" type="java.lang.String" />
<form-property name="description" type="java.lang.String" />
<form-property name="purpose" type="java.lang.String" />
<form-property name="format" type="java.lang.String" />
<form-property name="status" type="java.lang.String" />
<form-property name="queueId" type="java.lang.String" />
<form-property name="id" type="java.lang.String" />
</form-bean>
<action path="/Submit"
type="reporting.request.presentation.actions.SubmitRequest"
name="requestForm" scope="request" validate="true"
input=".request.Form">
<forward name="success" redirect="true" path="/Welcome.do"
/>
<forward name="view" redirect="true" path="/View.do" />
</action>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Strange problem with the validator.
Posted by Nathan Maves <Na...@Sun.COM>.
No ... it was the fact that I was missing the resource="false"
attribute. So the validator was looking for the var:maxLength key in
the application.properties which of course is not there.
Nathan
On Apr 17, 2004, at 6:02 AM, Erik Price wrote:
> But what was it, for the sake of the archives? It wasn't the fact
> that the "L" in "maxLength" wasn't capitalized, was it? (Because this
> recently bit one of our developers, as apparently JavaScript expects
> it to be capitalized [even though IIRC XHTML says it shouldn't be].)
>
>
> Erik
>
>
> On Apr 14, 2004, at 6:15 PM, Nathan Maves wrote:
>
>> Never mind! found the problem... one of those ID10T errors.
>>
>> Nathan
>> On Apr 14, 2004, at 3:33 PM, Nathan Maves wrote:
>>
>>> Anyone know why the error message does not show the maxlength
>>> argument.
>>>
>>> # Purpose can not be greater than characters.
>>> # Description can not be greater than characters.
>>>
>>> notice it places the first argument (name of the field) but not the
>>> max length.
>>>
>>>
>>> from the validation.xml
>>>
>>> <field property="purpose" depends="required, maxlength">
>>> <arg0 key="request.purpose" />
>>> <arg1 name="maxlength" key="${var:maxlength}" />
>>> <var>
>>> <var-name>maxlength</var-name>
>>> <var-value>2000</var-value>
>>> </var>
>>> </field>
>>>
>>>
>>>
>>> <form-bean name="requestForm"
>>> type="org.apache.struts.validator.DynaValidatorActionForm">
>>> <form-property name="name" type="java.lang.String" />
>>> <form-property name="description"
>>> type="java.lang.String" />
>>> <form-property name="purpose" type="java.lang.String" />
>>> <form-property name="format" type="java.lang.String" />
>>> <form-property name="status" type="java.lang.String" />
>>> <form-property name="queueId" type="java.lang.String" />
>>> <form-property name="id" type="java.lang.String" />
>>> </form-bean>
>>>
>>>
>>> <action path="/Submit"
>>> type="reporting.request.presentation.actions.SubmitRequest"
>>> name="requestForm" scope="request" validate="true"
>>> input=".request.Form">
>>> <forward name="success" redirect="true"
>>> path="/Welcome.do" />
>>> <forward name="view" redirect="true" path="/View.do" />
>>> </action>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>
>
>
>
>
> --
> Erik Price
>
> <http://erikprice.com/>
>
>
> ---------------------------------------------------------------------
> 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: Strange problem with the validator.
Posted by Erik Price <er...@mac.com>.
But what was it, for the sake of the archives? It wasn't the fact that
the "L" in "maxLength" wasn't capitalized, was it? (Because this
recently bit one of our developers, as apparently JavaScript expects it
to be capitalized [even though IIRC XHTML says it shouldn't be].)
Erik
On Apr 14, 2004, at 6:15 PM, Nathan Maves wrote:
> Never mind! found the problem... one of those ID10T errors.
>
> Nathan
> On Apr 14, 2004, at 3:33 PM, Nathan Maves wrote:
>
>> Anyone know why the error message does not show the maxlength
>> argument.
>>
>> # Purpose can not be greater than characters.
>> # Description can not be greater than characters.
>>
>> notice it places the first argument (name of the field) but not the
>> max length.
>>
>>
>> from the validation.xml
>>
>> <field property="purpose" depends="required, maxlength">
>> <arg0 key="request.purpose" />
>> <arg1 name="maxlength" key="${var:maxlength}" />
>> <var>
>> <var-name>maxlength</var-name>
>> <var-value>2000</var-value>
>> </var>
>> </field>
>>
>>
>>
>> <form-bean name="requestForm"
>> type="org.apache.struts.validator.DynaValidatorActionForm">
>> <form-property name="name" type="java.lang.String" />
>> <form-property name="description" type="java.lang.String"
>> />
>> <form-property name="purpose" type="java.lang.String" />
>> <form-property name="format" type="java.lang.String" />
>> <form-property name="status" type="java.lang.String" />
>> <form-property name="queueId" type="java.lang.String" />
>> <form-property name="id" type="java.lang.String" />
>> </form-bean>
>>
>>
>> <action path="/Submit"
>> type="reporting.request.presentation.actions.SubmitRequest"
>> name="requestForm" scope="request" validate="true"
>> input=".request.Form">
>> <forward name="success" redirect="true"
>> path="/Welcome.do" />
>> <forward name="view" redirect="true" path="/View.do" />
>> </action>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
--
Erik Price
<http://erikprice.com/>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Strange problem with the validator.
Posted by Nathan Maves <Na...@Sun.COM>.
Never mind! found the problem... one of those ID10T errors.
Nathan
On Apr 14, 2004, at 3:33 PM, Nathan Maves wrote:
> Anyone know why the error message does not show the maxlength argument.
>
> # Purpose can not be greater than characters.
> # Description can not be greater than characters.
>
> notice it places the first argument (name of the field) but not the
> max length.
>
>
> from the validation.xml
>
> <field property="purpose" depends="required, maxlength">
> <arg0 key="request.purpose" />
> <arg1 name="maxlength" key="${var:maxlength}" />
> <var>
> <var-name>maxlength</var-name>
> <var-value>2000</var-value>
> </var>
> </field>
>
>
>
> <form-bean name="requestForm"
> type="org.apache.struts.validator.DynaValidatorActionForm">
> <form-property name="name" type="java.lang.String" />
> <form-property name="description" type="java.lang.String"
> />
> <form-property name="purpose" type="java.lang.String" />
> <form-property name="format" type="java.lang.String" />
> <form-property name="status" type="java.lang.String" />
> <form-property name="queueId" type="java.lang.String" />
> <form-property name="id" type="java.lang.String" />
> </form-bean>
>
>
> <action path="/Submit"
> type="reporting.request.presentation.actions.SubmitRequest"
> name="requestForm" scope="request" validate="true"
> input=".request.Form">
> <forward name="success" redirect="true" path="/Welcome.do"
> />
> <forward name="view" redirect="true" path="/View.do" />
> </action>
>
>
> ---------------------------------------------------------------------
> 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