You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Laran Evans <lc...@cornell.edu> on 2004/08/11 19:08:14 UTC
When I use <html:errors /> I get a ClassCastException. So I used
<html:messages id="x" /> which displayed nothing, but worked.
ActionErrors doesn't accept ActionError objects any longer (deprecated),
just ActionMessage objects.
What's the consensus on the correct way to display <html:errors />
currently?
IA
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re:
Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Since ActionError extends ActionMessage then I don't think this is true.
When I converted a current app to Struts 1.2.x I'm sure it all still worked
with ActionError - I have now changed all ActionError to ActionMessage so
that I don't get all the "deprecated" warnings. Can you post your stack
trace with the ClassCastException?
Niall
----- Original Message -----
From: "Laran Evans" <lc...@cornell.edu>
To: "Struts User Mailing List" <us...@struts.apache.org>
Sent: Wednesday, August 11, 2004 6:08 PM
Subject: <html:errors />
> When I use <html:errors /> I get a ClassCastException. So I used
> <html:messages id="x" /> which displayed nothing, but worked.
>
> ActionErrors doesn't accept ActionError objects any longer (deprecated),
> just ActionMessage objects.
>
> What's the consensus on the correct way to display <html:errors />
> currently?
>
> IA
>
> ---------------------------------------------------------------------
> 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:
Posted by Kishore Senji <ks...@gmail.com>.
You might be getting a ClassCastException, because, you might be using
Struts 1.1, and adding a ActionMessage to ActionErrors and using the
<html:errors/> tag. The tag assumes ActionError object, so, when it
tries to cast your ActionMessage to ActionError, that's where you run
in to ClassCastException. So, instead of <html:errors/> use
<html:messages/> in the way shown below.
errors.add("name", new ActionMessage("user.name.empty.error"));
In jsp use,
<html:messages id="error" property="name">
<bean:write name="error" filter="false" />
</html:messages>
Kishore Senji.
On Wed, 11 Aug 2004 13:08:14 -0400, Laran Evans <lc...@cornell.edu> wrote:
> When I use <html:errors /> I get a ClassCastException. So I used
> <html:messages id="x" /> which displayed nothing, but worked.
>
> ActionErrors doesn't accept ActionError objects any longer (deprecated),
> just ActionMessage objects.
>
> What's the consensus on the correct way to display <html:errors />
> currently?
>
> IA
>
> ---------------------------------------------------------------------
> 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