click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Schellink <sab...@gmail.com>
Subject Re: Exception handling
Date Mon, 12 Mar 2012 16:30:17 GMT
Hi Seema,

The Click ErrorPage concept is really meant for exceptions that wasn't anticipated in the

application, ie RuntimeExceptions. You could always handle checked exceptions explicitly in
your 
services and pages ie. create and throw an ApplicationException class.

If you really want to handle RuntimeExceptions in your pages you could stick the exception
in the 
session as a flash variable[1][2] and retrieve the message from your page.

regards

Bob

[1]: 
http://click.apache.org/docs/click-api/org/apache/click/Context.html#setFlashAttribute%28java.lang.String,%20java.lang.Object%29
[2]: http://click.avoka.com/click-examples/general/flash.htm



On 12/03/2012 16:00 PM, gilbertoca [via click] wrote:
>     Seema wrote
>     I want to have a centralized mechanism for showing error messages in my pages for
exceptions
>     that are thrown to the UI layer. Instead of having a single error page across the
app, I want to
>     be able to show the error message in the same page that caused the error. I tried
extending
>     ClickServlet and overrided the handleException method where I'm able to get the error
message
>     corresponding to the exception. I need reference to the page object here so that
I can set the
>     error message as a bindable, but this method only takes the page class as the argument.
Can
>     someone suggest a solution?
>
> Hi, Seema!
>
> I recommend that you subscribe to the Apache Click mail-list[1].
>
> I've forwarded you question for all community.
>
> Hth,
>
> Gilberto
>
> [1] http://click.apache.org/docs/click-online.html#mailing-lists
>
> ----------------------------------------------------------------------------------------------------
> If you reply to this email, your message will be added to the discussion below:
> http://click.1134972.n2.nabble.com/Exception-handling-tp7364550p7365359.html
> This email was sent by gilbertoca
> <http://click.1134972.n2.nabble.com/template/NamlServlet.jtp?macro=user_nodes&user=249908>
(via Nabble)
> To receive all replies by email, subscribe to this discussion
> <http://click.1134972.n2.nabble.com/template/NamlServlet.jtp?macro=subscribe_by_code&node=7364550&code=ZGV2QGNsaWNrLmFwYWNoZS5vcmd8NzM2NDU1MHw1NzMzMTEwMTU=>


Mime
View raw message