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
<thiag...@gmail.com> wrote:
> Em Wed, 23 Sep 2009 11:57:15 -0300, Angelo Chen <angelochen...@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-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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

Reply via email to