You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2009/09/23 16:57:15 UTC

t5: redirect to a normal page in ExceptionReport

Hi,
I use an ExceptionReporter to catch error:

public class ExceptionReport implements ExceptionReporter {
//;
}

Is there a way to just redirect or forward to a normal page in the class
above? Thanks,

A.C.
-- 
View this message in context: http://www.nabble.com/t5%3A-redirect-to-a-normal-page-in-ExceptionReport-tp25531187p25531187.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: t5: redirect to a normal page in ExceptionReport

Posted by "Juan E. Maya" <ma...@gmail.com>.
I created a strategy around the RequestExceptionHandler to avoid
duplicated code in my pages.
It's something like:

public static RequestExceptionHandler
buildRequestExceptionHandlerStrategy(Map<Class,
RequestExceptionHandler> configuration, StrategyBuilder builder,
			@InjectService("RincoExceptionRequestExceptionHandler")
RequestExceptionHandler rincoExceptionRequestExceptionHandler,
			@InjectService("RequestExceptionHandler") RequestExceptionHandler
requestExceptionHandler) {

		configuration.put(RincoException.class,
rincoExceptionRequestExceptionHandler);
		configuration.put(Throwable.class, requestExceptionHandler);
		return builder.build(StrategyRegistry.newInstance(RequestExceptionHandler.class,
configuration));

}

This was i have total control on the the error page, allowing me to
show different pages per exception or even showing a friendly error
page on production mode or the default error page during development.

On Wed, Sep 23, 2009 at 5:02 PM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> Em Wed, 23 Sep 2009 11:57:15 -0300, Angelo Chen <an...@yahoo.com.hk>
> escreveu:
>
>> Hi,
>
> Hi!
>
>> Is there a way to just redirect or forward to a normal page in the class
>> above? Thanks,
>
> Return something in its onActivate() method.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: t5: redirect to a normal page in ExceptionReport

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Wed, 23 Sep 2009 11:57:15 -0300, Angelo Chen  
<an...@yahoo.com.hk> escreveu:

> Hi,

Hi!

> Is there a way to just redirect or forward to a normal page in the class
> above? Thanks,

Return something in its onActivate() method.

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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