You can override the default exception presenter class thru hivemind.

Create your own service for exceptionpresenter, and override the
tapestry.InfrastructureOverrides for exceptionPresenter.

Inside your ExceptionPresenter you can then can control whether you want to
display the nice simple error message or the detailed tapestry error page.

It looks like as follows:

<service-point id="ApplicationExceptionPresenter" interface="
org.apache.tapestry.error.ExceptionPresenter">
<invoke-factory>
<construct class="packagename.ApplicationExceptionPresenterImpl">
<set-object property="exceptionPageName"
value="infrastructure:exceptionPageName"/>  <!-- this one is the name of the
Tapestry's exception page that displayed the full detailed -->
        <set-object property="requestExceptionReporter"
                       value="infrastructure:requestExceptionReporter"/>
        <set-object property="responseRenderer"
                      value="infrastructure:responseRenderer"/>
</construct>
</invoke-factory>

</service-point>

<contribution configuration-id="tapestry.InfrastructureOverrides">
    <property name="exceptionPresenter"
object="service:ApplicationExceptionPresenter"/>
</contribution>


Alternatively,  I think you could make it simpler by modifying your Error
page to extend from the Tapestry Exception's page, and add either
@Conditional or @If to either display your error page, or follow similar to
what Tapestry's exception page does.


On 2/9/06, Chris Chiappone <[EMAIL PROTECTED]> wrote:
>
> One other question on this issue.  Is there a way to basically throw a
> redirectexception or something to show the full tapestry error page if
> I wanted to from within my CustomExceptionPage mainly for development?
>
> On 2/8/06, Greg Cormier <[EMAIL PROTECTED]> wrote:
> > I'm also looking to do this.
> >
> > I've overridden the default exception page, but it's quite plain.
> >
> > Does anyone know how you could basically add a header to that default
> page which has all the nice information, but at least we could say "An error
> has occured, please contact client support with this information.." etc etc,
> and then also probably do a font change on the traceback to something
> smaller.
> >
> > Thanks,
> > Greg
> >
> > -----Original Message-----
> > From: Muljadi Sulistio [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, February 08, 2006 2:20 PM
> > To: Tapestry users
> > Subject: Re: Custom Exception Page
> >
> >
> > Forgot to add that you'd also need to have a property or method named
> > "exception" in your custom exception page.
> >
> > The property type is Throwable, which will be called by the Tapestry
> default
> > ExceptionPresenter.
> >
> > You can see an example of this from the Vlib example in Tapestry 4.
> >
> > On 2/8/06, Muljadi Sulistio <[EMAIL PROTECTED]> wrote:
> > >
> > > If you are using Tapestry 4, you can change your hivemodule.xml as
> > > follows:
> > >
> > >     <contribution configuration-id="tapestry.InfrastructureOverrides">
> > >         <property name="exceptionPageName"
> value="ApplicationUnavailable"
> > > />
> > >     </contribution>
> > >
> > >
> > > On 2/8/06, Chris Chiappone <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Could someone lead me to the documentation on how to use a custom
> > > > exception page?  I've been searching through this list but haven't
> > > > really found the answer.
> > > >
> > > > Is the only think you need to do is add:
> > > >
> > > > <page name="Exception" specification-path=" CustomExceptionPage.page
> "/>
> > > >
> > > > to the tapp.application file
> > > >
> > > > Then create the CustomExceptionPage.page and
> CustomExceptionPage.htmlfiles?
> > > >
> > > >
> > > > --
> > > > ~chris
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > > >
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> ~chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to