You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Suresh Addagalla <su...@wipro.com> on 2003/01/13 06:07:45 UTC
RE: Declarative Exception Handling(solved)
Thanks David. It worked this way:
<logic:messagesPresent>
<html:messages id="error">
<bean:write name="<%= Action.EXCEPTION_KEY %>" property="message"/>
</html:messages>
</logic:messagesPresent>
Suresh
>-----Original Message-----
>From: David M. Karr [mailto:dmkarr@earthlink.net]
>Sent: Monday, January 13, 2003 12:15 AM
>To: struts-user@jakarta.apache.org
>Subject: Re: Declarative Exception Handling
>
>
>>>>>> "Suresh" == Suresh Addagalla <su...@wipro.com> writes:
>
> Suresh> Hi,
> Suresh> I still need some more help in this respect. If
>any of you have managed
> Suresh> to extract messages from exception objects using
>declarative exception
> Suresh> handling, please give me some inputs.
>
> Suresh> I have tried putting the following in my jsp.
>
> Suresh> <logic:present name="<%=Action.EXCEPTION_KEY%>">
> Suresh> <html:errors name="<%=Action.EXCEPTION_KEY%>"
>property="message"/>
> Suresh> </logic:present>
>
> Suresh> My action throws the InvalidLoginException and
>sets the "message"
> Suresh> attribute to some text.
>
> Suresh> I got the following error.
>
> Suresh> org.apache.jasper.JasperException: Cannot process
>ActionErrors instance
> Suresh> of class ss.prwp.service.InvalidLoginException
>
> Suresh> I have the following exceptin declared in
>struts-config.xml:
>
> Suresh> <exception type="ss.prwp.service.InvalidLoginException"
> Suresh> key="error.invalid.login" path="login.jsp" />
>
>The ActionErrors list and ActionError object have nothing to
>do with Exception
>objects. Your exception object is available as a bean with
>that key. Just
>reference it in any of the tags that can reference bean
>properties, but not the
>"errors" tag.
>
>--
>===================================================================
>David M. Karr ; Java/J2EE/XML/Unix/C++
>dmkarr@earthlink.net ; SCJP; SCWCD
>
>
>
>
>--
>To unsubscribe, e-mail:
><ma...@jakarta.apache.org>
>For
>additional commands,
>e-mail: <ma...@jakarta.apache.org>
>