You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Josh Joy <jo...@yahoo.com> on 2007/04/27 21:44:40 UTC

Create error page T4.0.2

Hi,

Sorry, though I've tried looking for the documentation
though I probably 
just missed it...
If tapestry experiences an error, for example I have
an invalid HTML 
template so it will have a parsing error, or perhaps I
have an 
application error, Tapestry will display a very nice
exception page with 
stack trace and various other info. This is helpful
for development, 
though for production how can I define my own error
page?

Thanks,
Josh

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


Re: Create error page T4.0.2

Posted by Matt Larson <sw...@ldnet.org>.
The absolute easiest thing to do is to create a page named Exception 
(.html and .page).  This will then be picked up automatically as the 
Exception page.  Unfortunately you may have to do some build script 
magic to differentiate between production and development.  I have my 
production Exception page log the error to a log file using Tapestry's 
exception display code but just display something generic for the user.

You should be able to override hivemind settings to accomplish this if 
you want to call you page something else. 

For more info there are various discussions of this in the email list 
archives.

Matt

Josh Joy wrote:
> Hi,
>
> Sorry, though I've tried looking for the documentation
> though I probably 
> just missed it...
> If tapestry experiences an error, for example I have
> an invalid HTML 
> template so it will have a parsing error, or perhaps I
> have an 
> application error, Tapestry will display a very nice
> exception page with 
> stack trace and various other info. This is helpful
> for development, 
> though for production how can I define my own error
> page?
>
> Thanks,
> Josh
>
> ---------------------------------------------------------------------
> 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: Create error page T4.0.2

Posted by Christian Dutaret <cd...@gmail.com>.
What I do is override the ExceptionPresenter service. My own implementation
somehow reads a system property, then redirects to either a custom generic
page or the standard tapestry exception page depending on the environment
(dev or prod).

2007/4/29, Jesse Kuhnert <jk...@gmail.com>:
>
> Thanks will fix.
>
> On 4/28/07, Martin Strand <do...@gmail.com> wrote:
> >
> > That page says "tapestry.Infrastructure", it should be
> > "tapestry.InfrastructureOverrides"
> >
> > Martin
> >
> > On Sun, 29 Apr 2007 04:44:19 +0200, Jesse Kuhnert <jk...@gmail.com>
> > wrote:
> >
> > > Right. For more on the hivemind specifics only see:
> > >
> > >
> >
> http://tapestry.apache.org/tapestry4.1/developmentguide/exceptionpages.html
> > >
> > > On 4/27/07, jake123 <ja...@gmail.com> wrote:
> > >>
> > >>
> > >> Hi Josh,
> > >> you can do a infrastructur override in your hivemodule.xml like this:
> > >>
> > >> <contribution configuration-id="tapestry.InfrastructureOverrides">
> > >>         <property name="exceptionPageName"
> value="CustomExceptionPage"
> > >> />
> > >>     </contribution>
> > >>
> > >> and then you create your own CustomExceptionPage:
> > >>
> > >> public abstract class CustomExceptionPage extends Exception
> implements
> > >> PageDetachListener {
> > >>
> > >> private static Logger log =
> > >> LoggerFactory.getLogger(CustomExceptionPage.class);
> > >>
> > >> public abstract void setExceptions(ExceptionDescription[]
> exceptions);
> > >>
> > >>     public void setException(Throwable value){
> > >>
> > >>         value.printStackTrace();
> > >>         try {
> > >>                 /* Send email with the error msg  */
> > >>
> > getCommunicationService().sendErrorExceptionEmail(value);
> > >>         } catch (Throwable exept) {
> > >>                         // DO NOTHING...
> > >>                 }
> > >>
> > >>     }
> > >>
> > >> }
> > >>
> > >> you can also create a filter in here that ignores the error msgs
> that's
> > >> creates by the web spiders and bots... if you want to..
> > >>
> > >> Cheers,
> > >> Jacob
> > >>
> > >>
> > >> Josh Joy wrote:
> > >> >
> > >> > Hi,
> > >> >
> > >> > Sorry, though I've tried looking for the documentation
> > >> > though I probably
> > >> > just missed it...
> > >> > If tapestry experiences an error, for example I have
> > >> > an invalid HTML
> > >> > template so it will have a parsing error, or perhaps I
> > >> > have an
> > >> > application error, Tapestry will display a very nice
> > >> > exception page with
> > >> > stack trace and various other info. This is helpful
> > >> > for development,
> > >> > though for production how can I define my own error
> > >> > page?
> > >> >
> > >> > Thanks,
> > >> > Josh
> > >> >
> > >> >
> ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >> > For additional commands, e-mail: users-help@tapestry.apache.org
> > >> >
> > >> >
> > >> >
> > >>
> > >> --
> > >> View this message in context:
> > >>
> http://www.nabble.com/Create-error-page-T4.0.2-tf3659480.html#a10227693
> > >> 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
> > >>
> > >>
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> Jesse Kuhnert
> Tapestry/Dojo team member/developer
>
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
>

Re: Create error page T4.0.2

Posted by Jesse Kuhnert <jk...@gmail.com>.
Thanks will fix.

On 4/28/07, Martin Strand <do...@gmail.com> wrote:
>
> That page says "tapestry.Infrastructure", it should be
> "tapestry.InfrastructureOverrides"
>
> Martin
>
> On Sun, 29 Apr 2007 04:44:19 +0200, Jesse Kuhnert <jk...@gmail.com>
> wrote:
>
> > Right. For more on the hivemind specifics only see:
> >
> >
> http://tapestry.apache.org/tapestry4.1/developmentguide/exceptionpages.html
> >
> > On 4/27/07, jake123 <ja...@gmail.com> wrote:
> >>
> >>
> >> Hi Josh,
> >> you can do a infrastructur override in your hivemodule.xml like this:
> >>
> >> <contribution configuration-id="tapestry.InfrastructureOverrides">
> >>         <property name="exceptionPageName" value="CustomExceptionPage"
> >> />
> >>     </contribution>
> >>
> >> and then you create your own CustomExceptionPage:
> >>
> >> public abstract class CustomExceptionPage extends Exception implements
> >> PageDetachListener {
> >>
> >> private static Logger log =
> >> LoggerFactory.getLogger(CustomExceptionPage.class);
> >>
> >> public abstract void setExceptions(ExceptionDescription[] exceptions);
> >>
> >>     public void setException(Throwable value){
> >>
> >>         value.printStackTrace();
> >>         try {
> >>                 /* Send email with the error msg  */
> >>
> getCommunicationService().sendErrorExceptionEmail(value);
> >>         } catch (Throwable exept) {
> >>                         // DO NOTHING...
> >>                 }
> >>
> >>     }
> >>
> >> }
> >>
> >> you can also create a filter in here that ignores the error msgs that's
> >> creates by the web spiders and bots... if you want to..
> >>
> >> Cheers,
> >> Jacob
> >>
> >>
> >> Josh Joy wrote:
> >> >
> >> > Hi,
> >> >
> >> > Sorry, though I've tried looking for the documentation
> >> > though I probably
> >> > just missed it...
> >> > If tapestry experiences an error, for example I have
> >> > an invalid HTML
> >> > template so it will have a parsing error, or perhaps I
> >> > have an
> >> > application error, Tapestry will display a very nice
> >> > exception page with
> >> > stack trace and various other info. This is helpful
> >> > for development,
> >> > though for production how can I define my own error
> >> > page?
> >> >
> >> > Thanks,
> >> > Josh
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> > For additional commands, e-mail: users-help@tapestry.apache.org
> >> >
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Create-error-page-T4.0.2-tf3659480.html#a10227693
> >> 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
> >>
> >>
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

Re: Create error page T4.0.2

Posted by Martin Strand <do...@gmail.com>.
That page says "tapestry.Infrastructure", it should be  
"tapestry.InfrastructureOverrides"

Martin

On Sun, 29 Apr 2007 04:44:19 +0200, Jesse Kuhnert <jk...@gmail.com>  
wrote:

> Right. For more on the hivemind specifics only see:
>
> http://tapestry.apache.org/tapestry4.1/developmentguide/exceptionpages.html
>
> On 4/27/07, jake123 <ja...@gmail.com> wrote:
>>
>>
>> Hi Josh,
>> you can do a infrastructur override in your hivemodule.xml like this:
>>
>> <contribution configuration-id="tapestry.InfrastructureOverrides">
>>         <property name="exceptionPageName" value="CustomExceptionPage"  
>> />
>>     </contribution>
>>
>> and then you create your own CustomExceptionPage:
>>
>> public abstract class CustomExceptionPage extends Exception implements
>> PageDetachListener {
>>
>> private static Logger log =
>> LoggerFactory.getLogger(CustomExceptionPage.class);
>>
>> public abstract void setExceptions(ExceptionDescription[] exceptions);
>>
>>     public void setException(Throwable value){
>>
>>         value.printStackTrace();
>>         try {
>>                 /* Send email with the error msg  */
>>                 getCommunicationService().sendErrorExceptionEmail(value);
>>         } catch (Throwable exept) {
>>                         // DO NOTHING...
>>                 }
>>
>>     }
>>
>> }
>>
>> you can also create a filter in here that ignores the error msgs that's
>> creates by the web spiders and bots... if you want to..
>>
>> Cheers,
>> Jacob
>>
>>
>> Josh Joy wrote:
>> >
>> > Hi,
>> >
>> > Sorry, though I've tried looking for the documentation
>> > though I probably
>> > just missed it...
>> > If tapestry experiences an error, for example I have
>> > an invalid HTML
>> > template so it will have a parsing error, or perhaps I
>> > have an
>> > application error, Tapestry will display a very nice
>> > exception page with
>> > stack trace and various other info. This is helpful
>> > for development,
>> > though for production how can I define my own error
>> > page?
>> >
>> > Thanks,
>> > Josh
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail: users-help@tapestry.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Create-error-page-T4.0.2-tf3659480.html#a10227693
>> 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
>>
>>
>
>



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


Re: Create error page T4.0.2

Posted by Jesse Kuhnert <jk...@gmail.com>.
Right. For more on the hivemind specifics only see:

http://tapestry.apache.org/tapestry4.1/developmentguide/exceptionpages.html

On 4/27/07, jake123 <ja...@gmail.com> wrote:
>
>
> Hi Josh,
> you can do a infrastructur override in your hivemodule.xml like this:
>
> <contribution configuration-id="tapestry.InfrastructureOverrides">
>         <property name="exceptionPageName" value="CustomExceptionPage" />
>     </contribution>
>
> and then you create your own CustomExceptionPage:
>
> public abstract class CustomExceptionPage extends Exception implements
> PageDetachListener {
>
> private static Logger log =
> LoggerFactory.getLogger(CustomExceptionPage.class);
>
> public abstract void setExceptions(ExceptionDescription[] exceptions);
>
>     public void setException(Throwable value){
>
>         value.printStackTrace();
>         try {
>                 /* Send email with the error msg  */
>                 getCommunicationService().sendErrorExceptionEmail(value);
>         } catch (Throwable exept) {
>                         // DO NOTHING...
>                 }
>
>     }
>
> }
>
> you can also create a filter in here that ignores the error msgs that's
> creates by the web spiders and bots... if you want to..
>
> Cheers,
> Jacob
>
>
> Josh Joy wrote:
> >
> > Hi,
> >
> > Sorry, though I've tried looking for the documentation
> > though I probably
> > just missed it...
> > If tapestry experiences an error, for example I have
> > an invalid HTML
> > template so it will have a parsing error, or perhaps I
> > have an
> > application error, Tapestry will display a very nice
> > exception page with
> > stack trace and various other info. This is helpful
> > for development,
> > though for production how can I define my own error
> > page?
> >
> > Thanks,
> > Josh
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Create-error-page-T4.0.2-tf3659480.html#a10227693
> 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
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

Re: Create error page T4.0.2

Posted by jake123 <ja...@gmail.com>.
Hi Josh,
you can do a infrastructur override in your hivemodule.xml like this:

<contribution configuration-id="tapestry.InfrastructureOverrides">
        <property name="exceptionPageName" value="CustomExceptionPage" />
    </contribution>

and then you create your own CustomExceptionPage:

public abstract class CustomExceptionPage extends Exception implements
PageDetachListener {

private static Logger log =
LoggerFactory.getLogger(CustomExceptionPage.class);

 public abstract void setExceptions(ExceptionDescription[] exceptions);

    public void setException(Throwable value){
         
        value.printStackTrace();
        try {
                /* Send email with the error msg  */
        	getCommunicationService().sendErrorExceptionEmail(value);
        } catch (Throwable exept) {
			// DO NOTHING...
		} 

    }

}

you can also create a filter in here that ignores the error msgs that's
creates by the web spiders and bots... if you want to..

Cheers,
Jacob


Josh Joy wrote:
> 
> Hi,
> 
> Sorry, though I've tried looking for the documentation
> though I probably 
> just missed it...
> If tapestry experiences an error, for example I have
> an invalid HTML 
> template so it will have a parsing error, or perhaps I
> have an 
> application error, Tapestry will display a very nice
> exception page with 
> stack trace and various other info. This is helpful
> for development, 
> though for production how can I define my own error
> page?
> 
> Thanks,
> Josh
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Create-error-page-T4.0.2-tf3659480.html#a10227693
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