You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Bradford M. Ayers" <ba...@gsmr.org> on 2003/12/17 21:36:51 UTC

problem with adding ActionMessage to ActionErrors

I noticed in the documentation that ActionError is deprecated, so I was trying to be a good doobie and use ActionMessage like the docs say to.  So in my code, when I go from this:
errors.add( ActionErrors.GLOBAL_ERROR, new ActionMessage( "error.password.mismatch" ));
to this:
errors.add( ActionErrors.GLOBAL_ERROR, new ActionError( "error.password.mismatch" ));
when my page tries to resolve     <html:errors/> I get:
java.lang.ClassCastException
	at org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:215)...

Has anyone seen this?  I'm using JBoss 3.2.2 (which uses Tomcat 4.1).


Brad Ayers
Senior Programmer Analyst
Granite State Management and Resources
bayers@gsmr.org
603-225-5867 ext. 308
603-224-2581  Fax number

CONFIDENTIALITY NOTICE

This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential and privileged
information.  Any unauthorized review, use, disclosure or distribution is
prohibited.  If you are not the intended recipient, please contact the
sender by reply e-mail and destroy all copies of the original message.



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


Re: problem with adding ActionMessage to ActionErrors

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
On 12/17/2003 09:36 PM&nbsp;Bradford M. Ayers wrote:
> I noticed in the documentation that ActionError is deprecated, so I
> was trying to be a good doobie and use ActionMessage like the docs
> say to.  So in my code, when I go from this: errors.add(
> ActionErrors.GLOBAL_ERROR, new ActionMessage(
> "error.password.mismatch" )); to this: errors.add(
> ActionErrors.GLOBAL_ERROR, new ActionError( "error.password.mismatch"
> )); when my page tries to resolve     <html:errors/> I get: 
> java.lang.ClassCastException at
> org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:215)...
> 
> 
> Has anyone seen this?  I'm using JBoss 3.2.2 (which uses Tomcat 4.1).
> 
Hi Bradford,

I think the ErrorsTag is expecting an ActionErrors collection and you 
are giving it an ActionMessages. Is that so?

I could be wrong but this is an area that I only managed to understand 
for about 30 minutes while I implemented it, and then I forgot it 
immediately. :O

Adam

-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian

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


Re: problem with adding ActionMessage to ActionErrors

Posted by yoge <yo...@adventnet.com>.
Use
 *<html:messages id="msg" message="false">
    <bean:write name="msg"/>    
</html:messages>*

instead of *<html:errors>*

Bradford M. Ayers wrote:

>I noticed in the documentation that ActionError is deprecated, so I was trying to be a good doobie and use ActionMessage like the docs say to.  So in my code, when I go from this:
>errors.add( ActionErrors.GLOBAL_ERROR, new ActionMessage( "error.password.mismatch" ));
>to this:
>errors.add( ActionErrors.GLOBAL_ERROR, new ActionError( "error.password.mismatch" ));
>when my page tries to resolve     <html:errors/> I get:
>java.lang.ClassCastException
>	at org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:215)...
>
>Has anyone seen this?  I'm using JBoss 3.2.2 (which uses Tomcat 4.1).
>
>
>Brad Ayers
>Senior Programmer Analyst
>Granite State Management and Resources
>bayers@gsmr.org
>603-225-5867 ext. 308
>603-224-2581  Fax number
>
>CONFIDENTIALITY NOTICE
>
>This e-mail message, including any attachments, is for the sole use of the
>intended recipient(s) and may contain confidential and privileged
>information.  Any unauthorized review, use, disclosure or distribution is
>prohibited.  If you are not the intended recipient, please contact the
>sender by reply e-mail and destroy all copies of the original message.
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>  
>