You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by m_salman <mo...@yahoo.com> on 2008/08/27 08:38:02 UTC

Handling Exceptions in WebSession or WebApplication

Hi,

In my subclass of WebSession the constructor has to call a method that
throws an exception.  As you know the WebApplication calls the constructor
of the WebSession.  


	public UserSession(Request request)
	{
		super(request);
		try
		{
			user = Cache.getInstance().getAnonymousUser();
		}
		catch (ApplicationException e)
		{
			// What should I do here????
		}
	}



What I would like to know is what is the best way to handle an exception in
these classes without swallowing it.  I don't want to just log the
exception. Is there a way to show an error page?  I don't see  any
setResponsePage method.

Thanks.
-- 
View this message in context: http://www.nabble.com/Handling-Exceptions-in-WebSession-or-WebApplication-tp19175475p19175475.html
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


Re: Handling Exceptions in WebSession or WebApplication

Posted by m_salman <mo...@yahoo.com>.
That works. Thanks.  



throw restartresponseexception with your error page


-- 
View this message in context: http://www.nabble.com/Handling-Exceptions-in-WebSession-or-WebApplication-tp19175475p19175698.html
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


Re: Handling Exceptions in WebSession or WebApplication

Posted by Martijn Dashorst <ma...@gmail.com>.
throw restartresponseexception with your error page

On 8/27/08, m_salman <mo...@yahoo.com> wrote:
>
> Hi,
>
> In my subclass of WebSession the constructor has to call a method that
> throws an exception.  As you know the WebApplication calls the constructor
> of the WebSession.
>
>
> 	public UserSession(Request request)
> 	{
> 		super(request);
> 		try
> 		{
> 			user = Cache.getInstance().getAnonymousUser();
> 		}
> 		catch (ApplicationException e)
> 		{
> 			// What should I do here????
> 		}
> 	}
>
>
>
> What I would like to know is what is the best way to handle an exception in
> these classes without swallowing it.  I don't want to just log the
> exception. Is there a way to show an error page?  I don't see  any
> setResponsePage method.
>
> Thanks.
> --
> View this message in context:
> http://www.nabble.com/Handling-Exceptions-in-WebSession-or-WebApplication-tp19175475p19175475.html
> 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
>
>


-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org