You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Max Kovalenkov <ma...@sun.com> on 2004/03/05 22:06:20 UTC
throws exception
Hi!
I have a custom validator which works fine, but when the <html:errors/>
tag is being executed, it throws a ClassCastException. My validator has
the following line for adding to error messages:
errors.add( field.getKey(), new ActionMessage("errors.dates", date1,
date2));
If validation passes, the above line is not executed, and everything
works(even if there are errors in other fields of the form), the tag
prints errors normally.
I am puzzled. Could anyone suggest the reason for this exception? Thanks.
Max
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: throws exception [problem solved]
Posted by Max Kovalenkov <ma...@sun.com>.
You're absolutely correct.
Thank you! And thanks to as as for answering!
Max
Hubert Rabago wrote:
> If you're using 1.1, try passing ActionError objects instead of ActionMessage
> objects. The syntax should be the same, you'll just use a different object.
>
> Hubert
>
> --- Max Kovalenkov <ma...@sun.com> wrote:
>
>>Hi!
>>
>>I have a custom validator which works fine, but when the <html:errors/>
>>tag is being executed, it throws a ClassCastException. My validator has
>>the following line for adding to error messages:
>>
>>errors.add( field.getKey(), new ActionMessage("errors.dates", date1,
>>date2));
>>
>>If validation passes, the above line is not executed, and everything
>>works(even if there are errors in other fields of the form), the tag
>>prints errors normally.
>>I am puzzled. Could anyone suggest the reason for this exception? Thanks.
>>
>>Max
>>
>>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Search - Find what you’re looking for faster
> http://search.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: throws exception
Posted by Hubert Rabago <ja...@yahoo.com>.
If you're using 1.1, try passing ActionError objects instead of ActionMessage
objects. The syntax should be the same, you'll just use a different object.
Hubert
--- Max Kovalenkov <ma...@sun.com> wrote:
> Hi!
>
> I have a custom validator which works fine, but when the <html:errors/>
> tag is being executed, it throws a ClassCastException. My validator has
> the following line for adding to error messages:
>
> errors.add( field.getKey(), new ActionMessage("errors.dates", date1,
> date2));
>
> If validation passes, the above line is not executed, and everything
> works(even if there are errors in other fields of the form), the tag
> prints errors normally.
> I am puzzled. Could anyone suggest the reason for this exception? Thanks.
>
> Max
>
>
__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you�re looking for faster
http://search.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: throws exception
Posted by as as <sa...@yahoo.com>.
Hi,
I saw this error but probably in a different, though related context.
For eg, in my case, it was occuring as I declared my form as bookForm in struts-config.xml but in my book.jsp, it was <html:for name = "booksForm"....
So may be checking this stuff in struts-config.xml may help....
Thanks.
Max Kovalenkov <ma...@sun.com> wrote:
Hi!
I have a custom validator which works fine, but when the
tag is being executed, it throws a ClassCastException. My validator has
the following line for adding to error messages:
errors.add( field.getKey(), new ActionMessage("errors.dates", date1,
date2));
If validation passes, the above line is not executed, and everything
works(even if there are errors in other fields of the form), the tag
prints errors normally.
I am puzzled. Could anyone suggest the reason for this exception? Thanks.
Max
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what you�re looking for faster.