You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Per Newgro <pe...@gmx.ch> on 2007/09/21 22:19:46 UTC
Howto handle exceptions?
Hi *,
is there a wicket way for handling exceptions? I call my beans from my
controller which manages the wicket-view (Panel, Page ...). Some exceptions i
want to handle in the controller. But sometimes there are NPEs or IAEs. I
would like to send them all to an error page, but without handling the
exception. Is wicket presenting automatically a not handled exception?
Is there a little example?
Hope you can help me
Cheers
Per
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Howto handle exceptions?
Posted by Eelco Hillenius <ee...@gmail.com>.
> > is there a wicket way for handling exceptions? I call my beans from my
> > controller which manages the wicket-view (Panel, Page ...). Some
> > exceptions i
> > want to handle in the controller. But sometimes there are NPEs or IAEs. I
> > would like to send them all to an error page, but without handling the
> > exception. Is wicket presenting automatically a not handled exception?
> >
>
> This is done automatically in deployment mode. In development mode, you can
> enable it like:
>
> public class MyApp extends WebApplication {
> protected void init() {
> getExceptionSettings().setUnexpectedExceptionDisplay(
> IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
> }
> }
>
> This will display wicket's internal error page. If you need to provide your
> own
> page, try:
>
> getApplicationSettings().setInternalErrorPage(MyErrorPage.class);
>
Also, you can provide your own request cycle and override
onRuntimeException for maximum control. You can always let that
delegate to default error handling (including what error page is set
etc).
Eelco
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Howto handle exceptions?
Posted by Kent Tong <ke...@cpttm.org.mo>.
Newgro wrote:
>
> is there a wicket way for handling exceptions? I call my beans from my
> controller which manages the wicket-view (Panel, Page ...). Some
> exceptions i
> want to handle in the controller. But sometimes there are NPEs or IAEs. I
> would like to send them all to an error page, but without handling the
> exception. Is wicket presenting automatically a not handled exception?
>
This is done automatically in deployment mode. In development mode, you can
enable it like:
public class MyApp extends WebApplication {
protected void init() {
getExceptionSettings().setUnexpectedExceptionDisplay(
IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
}
}
This will display wicket's internal error page. If you need to provide your
own
page, try:
getApplicationSettings().setInternalErrorPage(MyErrorPage.class);
--
View this message in context: http://www.nabble.com/Howto-handle-exceptions--tf4498352.html#a12834389
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org