You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nicola Ken Barozzi <ni...@apache.org> on 2002/10/16 12:28:19 UTC
[SUMMARY] Exception object in handle-errors? < Re: Coocon Error Handling
>
Murari wrote:
> In cocoon we have this tag to show the error message
>
> <map:handle-errors>
> <map:transform
> src="../stylesheets/system/error2html.xsl"/>
> <map:serialize status-code="500"/>
> </map:handle-errors>
>
> But I want to customize the error messages...and I want to display the
> message according to the the exception catch...in coocn there is only
> stylesheet ,it displaying exception as it is
>
> So How to cature the Exception object in stylesheet and show the
> message???
In <handle-errors/> Cocoon places in the Context the Notifying Object
that was created from the Exception.
NotifyingGenerator (the default one) does it like this:
notification = (Notifying)objectModel.get(Constants.NOTIFYING_OBJECT);
So you can use this object in an Action for example, or other Cocoon
components, to make the selection.
Or simply make a stylesheet that uses <xsl:choose> to show the
appropriate message.
--
Nicola Ken Barozzi nicolaken@apache.org
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: [SUMMARY] Exception object in handle-errors? < Re: Coocon Error Handling >
Posted by Murari <mu...@vmoksha.com>.
Hello,
I m not able to get that object in action...can u tell me how will I get
this object in XSP and how will I call get and set method on that.
-----Original Message-----
From: Nicola Ken Barozzi [mailto:nicolaken@apache.org]
Sent: Wednesday, October 16, 2002 6:28 PM
To: cocoon-users@xml.apache.org
Subject: [SUMMARY] Exception object in handle-errors? < Re: Coocon Error
Handling >
Murari wrote:
> In cocoon we have this tag to show the error message
>
> <map:handle-errors>
> <map:transform
src="../stylesheets/system/error2html.xsl"/>
> <map:serialize status-code="500"/>
> </map:handle-errors>
>
> But I want to customize the error messages...and I want to display the
> message according to the the exception catch...in coocn there is only
> stylesheet ,it displaying exception as it is
>
> So How to cature the Exception object in stylesheet and show the
> message???
In <handle-errors/> Cocoon places in the Context the Notifying Object
that was created from the Exception.
NotifyingGenerator (the default one) does it like this:
notification =
(Notifying)objectModel.get(Constants.NOTIFYING_OBJECT);
So you can use this object in an Action for example, or other Cocoon
components, to make the selection.
Or simply make a stylesheet that uses <xsl:choose> to show the
appropriate message.
--
Nicola Ken Barozzi nicolaken@apache.org
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>