Re: 404 from onActivate
Christophe, Thanks a lot, that did the trick nicely on both environments. Cheers, Joost Christophe Cordenier wrote: Hi To avoid the problem with Tomcat i use to implement a ComponentEventResultProcessor to call the sendError() See this thread for other solutions http://markmail.org/thread/vfeoddnlptmuxf6e Regards, Christophe Cordenier. Developer of wo...@wookicentral.com 2010/3/25 Joost Schouten (ml) Hi Jan, Did you find a solution to this problem on tomcat? I am faced with exectly the same situation where the response.sendError(404, null); works great in jetty but not on tomcat. Cheers, Joost Jan Jirout wrote: Hi, thanks for replay. My situation is exactly as you wrote. After all this approach works just in case of Jetty. It doesn't work with Tomcat 6.0.20 and 6.0.24. I have tested it. Only difference between processing page that should lead to error404 is that at tomcat page processing continue after error 404 in send, so there appears some NullPointerExceptions. I don't see this exception at Jetty. Jan Kalle Korhonen wrote: If you want Tapestry to render your error page, you need to configure the filter to handle error dispatches: app /* REQUEST ERROR Entirely possible that Jetty would route this to the app by default but I think it's off-spec. Kalle On Fri, Mar 19, 2010 at 2:50 PM, Jan Jirout wrote: Hi, I have same problem. I don't like solution with HTTP redirect to page that return 404 also. This solution is not fully logic from user perspective. I would like to by able to show error404 without any redirect. I have tried in onActivation method code: response.sendError(404, null); where: @Inject private org.apache.tapestry5.services.Response response; It works in jetty, but didn't work in Tomcat ;-). I hope, that somebody will help. Regards Jan Igor Drobiazko wrote: Just inject service RequestGlobals [1] into your page, retrieve the Response from it and send the 404 error to the client. [1] http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/RequestGlobals.html On Fri, Mar 19, 2010 at 6:39 PM, Mike Oestereter wrote: That's what I'm doing at the moment, but is not what I want. The result from the user's perspective is is a redirect 302 (or something) to a 404, which I don't think makes sense? On Fri, Mar 19, 2010 at 4:51 PM, Christian Riedel wrote: I would create an Error404.java page and redirect to it in case your onActivate doesn't find a corresponding entity. Am 19.03.2010 um 15:04 schrieb Mike Oestereter: Hello I've got a page that takes the context as parameter to produce a result from db, e.g.: http:/hostname/app/page/123 If the db result for 123 does not exist I would like to throw a 404. Currently I'm using... Object onActivate(EventContext context) { //db lookup code to prepare page } Is the best way to throw a custom error that gets picked up by the ExceptionReport page and "rendered" with a status code of 404? Or is there a way to initialize/prepare the page earlier in the cycle and detect the non existence of resource 123? Thanks Theo - 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 - 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 - 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 - 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
Re: 404 from onActivate
Hi To avoid the problem with Tomcat i use to implement a ComponentEventResultProcessor to call the sendError() See this thread for other solutions http://markmail.org/thread/vfeoddnlptmuxf6e Regards, Christophe Cordenier. Developer of wo...@wookicentral.com 2010/3/25 Joost Schouten (ml) > Hi Jan, > > Did you find a solution to this problem on tomcat? I am faced with exectly > the same situation where the response.sendError(404, null); works great in > jetty but not on tomcat. > > Cheers, > Joost > > > Jan Jirout wrote: > >> Hi, >> >> thanks for replay. My situation is exactly as you wrote. After all this >> approach works just in case of Jetty. It doesn't work with Tomcat 6.0.20 and >> 6.0.24. I have tested it. Only difference between processing page that >> should lead to error404 is that at tomcat page processing continue after >> error 404 in send, so there appears some NullPointerExceptions. I don't see >> this exception at Jetty. >> >> Jan >> >> >> Kalle Korhonen wrote: >> >>> If you want Tapestry to render your error page, you need to configure >>> the filter to handle error dispatches: >>> >>>app >>>/* >>>REQUEST >>>ERROR >>> >>> >>> Entirely possible that Jetty would route this to the app by default >>> but I think it's off-spec. >>> >>> Kalle >>> >>> >>> On Fri, Mar 19, 2010 at 2:50 PM, Jan Jirout wrote: >>> >>> Hi, I have same problem. I don't like solution with HTTP redirect to page that return 404 also. This solution is not fully logic from user perspective. I would like to by able to show error404 without any redirect. I have tried in onActivation method code: response.sendError(404, null); where: @Inject private org.apache.tapestry5.services.Response response; It works in jetty, but didn't work in Tomcat ;-). I hope, that somebody will help. Regards Jan Igor Drobiazko wrote: > Just inject service RequestGlobals [1] into your page, retrieve the > Response > from it and send the 404 error to the client. > > [1] > > > http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/RequestGlobals.html > > On Fri, Mar 19, 2010 at 6:39 PM, Mike Oestereter > wrote: > > > > >> That's what I'm doing at the moment, but is not what I want. >> The result from the user's perspective is is a redirect 302 (or >> something) to a 404, which I don't think makes sense? >> >> On Fri, Mar 19, 2010 at 4:51 PM, Christian Riedel >> wrote: >> >> >> >>> I would create an Error404.java page and redirect to it in case your >>> >>> >>> >> onActivate doesn't find a corresponding entity. >> >> >> >>> Am 19.03.2010 um 15:04 schrieb Mike Oestereter: >>> >>> >>> >>> Hello I've got a page that takes the context as parameter to produce a result from db, e.g.: http:/hostname/app/page/123 If the db result for 123 does not exist I would like to throw a 404. Currently I'm using... Object onActivate(EventContext context) { //db lookup code to prepare page } Is the best way to throw a custom error that gets picked up by the ExceptionReport page and "rendered" with a status code of 404? Or is there a way to initialize/prepare the page earlier in the cycle and detect the non existence of resource 123? Thanks Theo - 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 >>> >>> >>> >>> >>> >> - >> 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 >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>> For additional commands, e-mail: users-h...@tapestry.apache.org >>> >>> >>> >>> >> >> >> -
Re: 404 from onActivate
Hi Jan, Did you find a solution to this problem on tomcat? I am faced with exectly the same situation where the response.sendError(404, null); works great in jetty but not on tomcat. Cheers, Joost Jan Jirout wrote: Hi, thanks for replay. My situation is exactly as you wrote. After all this approach works just in case of Jetty. It doesn't work with Tomcat 6.0.20 and 6.0.24. I have tested it. Only difference between processing page that should lead to error404 is that at tomcat page processing continue after error 404 in send, so there appears some NullPointerExceptions. I don't see this exception at Jetty. Jan Kalle Korhonen wrote: If you want Tapestry to render your error page, you need to configure the filter to handle error dispatches: app /* REQUEST ERROR Entirely possible that Jetty would route this to the app by default but I think it's off-spec. Kalle On Fri, Mar 19, 2010 at 2:50 PM, Jan Jirout wrote: Hi, I have same problem. I don't like solution with HTTP redirect to page that return 404 also. This solution is not fully logic from user perspective. I would like to by able to show error404 without any redirect. I have tried in onActivation method code: response.sendError(404, null); where: @Inject private org.apache.tapestry5.services.Response response; It works in jetty, but didn't work in Tomcat ;-). I hope, that somebody will help. Regards Jan Igor Drobiazko wrote: Just inject service RequestGlobals [1] into your page, retrieve the Response from it and send the 404 error to the client. [1] http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/RequestGlobals.html On Fri, Mar 19, 2010 at 6:39 PM, Mike Oestereter wrote: That's what I'm doing at the moment, but is not what I want. The result from the user's perspective is is a redirect 302 (or something) to a 404, which I don't think makes sense? On Fri, Mar 19, 2010 at 4:51 PM, Christian Riedel wrote: I would create an Error404.java page and redirect to it in case your onActivate doesn't find a corresponding entity. Am 19.03.2010 um 15:04 schrieb Mike Oestereter: Hello I've got a page that takes the context as parameter to produce a result from db, e.g.: http:/hostname/app/page/123 If the db result for 123 does not exist I would like to throw a 404. Currently I'm using... Object onActivate(EventContext context) { //db lookup code to prepare page } Is the best way to throw a custom error that gets picked up by the ExceptionReport page and "rendered" with a status code of 404? Or is there a way to initialize/prepare the page earlier in the cycle and detect the non existence of resource 123? Thanks Theo - 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 - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 404 from onActivate
Hi, thanks for replay. My situation is exactly as you wrote. After all this approach works just in case of Jetty. It doesn't work with Tomcat 6.0.20 and 6.0.24. I have tested it. Only difference between processing page that should lead to error404 is that at tomcat page processing continue after error 404 in send, so there appears some NullPointerExceptions. I don't see this exception at Jetty. Jan Kalle Korhonen wrote: If you want Tapestry to render your error page, you need to configure the filter to handle error dispatches: app /* REQUEST ERROR Entirely possible that Jetty would route this to the app by default but I think it's off-spec. Kalle On Fri, Mar 19, 2010 at 2:50 PM, Jan Jirout wrote: Hi, I have same problem. I don't like solution with HTTP redirect to page that return 404 also. This solution is not fully logic from user perspective. I would like to by able to show error404 without any redirect. I have tried in onActivation method code: response.sendError(404, null); where: @Inject private org.apache.tapestry5.services.Response response; It works in jetty, but didn't work in Tomcat ;-). I hope, that somebody will help. Regards Jan Igor Drobiazko wrote: Just inject service RequestGlobals [1] into your page, retrieve the Response from it and send the 404 error to the client. [1] http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/RequestGlobals.html On Fri, Mar 19, 2010 at 6:39 PM, Mike Oestereter wrote: That's what I'm doing at the moment, but is not what I want. The result from the user's perspective is is a redirect 302 (or something) to a 404, which I don't think makes sense? On Fri, Mar 19, 2010 at 4:51 PM, Christian Riedel wrote: I would create an Error404.java page and redirect to it in case your onActivate doesn't find a corresponding entity. Am 19.03.2010 um 15:04 schrieb Mike Oestereter: Hello I've got a page that takes the context as parameter to produce a result from db, e.g.: http:/hostname/app/page/123 If the db result for 123 does not exist I would like to throw a 404. Currently I'm using... Object onActivate(EventContext context) { //db lookup code to prepare page } Is the best way to throw a custom error that gets picked up by the ExceptionReport page and "rendered" with a status code of 404? Or is there a way to initialize/prepare the page earlier in the cycle and detect the non existence of resource 123? Thanks Theo - 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 - 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 - 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
Re: 404 from onActivate
Actually, you can directly inject the Response object (the Response service is a shadow of RequestGlobals.response). On Fri, Mar 19, 2010 at 1:11 PM, Igor Drobiazko wrote: > Just inject service RequestGlobals [1] into your page, retrieve the Response > from it and send the 404 error to the client. > > [1] > http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/RequestGlobals.html > > On Fri, Mar 19, 2010 at 6:39 PM, Mike Oestereter > wrote: > >> That's what I'm doing at the moment, but is not what I want. >> The result from the user's perspective is is a redirect 302 (or >> something) to a 404, which I don't think makes sense? >> >> On Fri, Mar 19, 2010 at 4:51 PM, Christian Riedel >> wrote: >> > I would create an Error404.java page and redirect to it in case your >> onActivate doesn't find a corresponding entity. >> > >> > Am 19.03.2010 um 15:04 schrieb Mike Oestereter: >> > >> >> Hello >> >> >> >> I've got a page that takes the context as parameter to produce a >> >> result from db, e.g.: http:/hostname/app/page/123 >> >> >> >> If the db result for 123 does not exist I would like to throw a 404. >> >> >> >> Currently I'm using... >> >> >> >> Object onActivate(EventContext context) { >> >> //db lookup code to prepare page >> >> } >> >> >> >> Is the best way to throw a custom error that gets picked up by the >> >> ExceptionReport page and "rendered" with a status code of 404? >> >> >> >> Or is there a way to initialize/prepare the page earlier in the cycle >> >> and detect the non existence of resource 123? >> >> >> >> Thanks >> >> Theo >> >> >> >> - >> >> 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 >> > >> > >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> > > > -- > Best regards, > > Igor Drobiazko > http://tapestry5.de/blog > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 404 from onActivate
If you want Tapestry to render your error page, you need to configure the filter to handle error dispatches: app /* REQUEST ERROR Entirely possible that Jetty would route this to the app by default but I think it's off-spec. Kalle On Fri, Mar 19, 2010 at 2:50 PM, Jan Jirout wrote: > Hi, > > I have same problem. I don't like solution with HTTP redirect to page that > return 404 also. This solution is not fully logic from user perspective. I > would like to by able to show error404 without any redirect. > > I have tried in onActivation method code: > > response.sendError(404, null); > > where: > > @Inject > private org.apache.tapestry5.services.Response response; > > It works in jetty, but didn't work in Tomcat ;-). I hope, that somebody will > help. > > Regards > > Jan > > Igor Drobiazko wrote: >> >> Just inject service RequestGlobals [1] into your page, retrieve the >> Response >> from it and send the 404 error to the client. >> >> [1] >> >> http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/RequestGlobals.html >> >> On Fri, Mar 19, 2010 at 6:39 PM, Mike Oestereter >> wrote: >> >> >>> >>> That's what I'm doing at the moment, but is not what I want. >>> The result from the user's perspective is is a redirect 302 (or >>> something) to a 404, which I don't think makes sense? >>> >>> On Fri, Mar 19, 2010 at 4:51 PM, Christian Riedel >>> wrote: >>> I would create an Error404.java page and redirect to it in case your >>> >>> onActivate doesn't find a corresponding entity. >>> Am 19.03.2010 um 15:04 schrieb Mike Oestereter: > > Hello > > I've got a page that takes the context as parameter to produce a > result from db, e.g.: http:/hostname/app/page/123 > > If the db result for 123 does not exist I would like to throw a 404. > > Currently I'm using... > > Object onActivate(EventContext context) { > //db lookup code to prepare page > } > > Is the best way to throw a custom error that gets picked up by the > ExceptionReport page and "rendered" with a status code of 404? > > Or is there a way to initialize/prepare the page earlier in the cycle > and detect the non existence of resource 123? > > Thanks > Theo > > - > 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 >>> >>> - >>> 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 > > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 404 from onActivate
Hi, I have same problem. I don't like solution with HTTP redirect to page that return 404 also. This solution is not fully logic from user perspective. I would like to by able to show error404 without any redirect. I have tried in onActivation method code: response.sendError(404, null); where: @Inject private org.apache.tapestry5.services.Response response; It works in jetty, but didn't work in Tomcat ;-). I hope, that somebody will help. Regards Jan Igor Drobiazko wrote: Just inject service RequestGlobals [1] into your page, retrieve the Response from it and send the 404 error to the client. [1] http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/RequestGlobals.html On Fri, Mar 19, 2010 at 6:39 PM, Mike Oestereter wrote: That's what I'm doing at the moment, but is not what I want. The result from the user's perspective is is a redirect 302 (or something) to a 404, which I don't think makes sense? On Fri, Mar 19, 2010 at 4:51 PM, Christian Riedel wrote: I would create an Error404.java page and redirect to it in case your onActivate doesn't find a corresponding entity. Am 19.03.2010 um 15:04 schrieb Mike Oestereter: Hello I've got a page that takes the context as parameter to produce a result from db, e.g.: http:/hostname/app/page/123 If the db result for 123 does not exist I would like to throw a 404. Currently I'm using... Object onActivate(EventContext context) { //db lookup code to prepare page } Is the best way to throw a custom error that gets picked up by the ExceptionReport page and "rendered" with a status code of 404? Or is there a way to initialize/prepare the page earlier in the cycle and detect the non existence of resource 123? Thanks Theo - 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 - 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
Re: 404 from onActivate
Just inject service RequestGlobals [1] into your page, retrieve the Response from it and send the 404 error to the client. [1] http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/RequestGlobals.html On Fri, Mar 19, 2010 at 6:39 PM, Mike Oestereter wrote: > That's what I'm doing at the moment, but is not what I want. > The result from the user's perspective is is a redirect 302 (or > something) to a 404, which I don't think makes sense? > > On Fri, Mar 19, 2010 at 4:51 PM, Christian Riedel > wrote: > > I would create an Error404.java page and redirect to it in case your > onActivate doesn't find a corresponding entity. > > > > Am 19.03.2010 um 15:04 schrieb Mike Oestereter: > > > >> Hello > >> > >> I've got a page that takes the context as parameter to produce a > >> result from db, e.g.: http:/hostname/app/page/123 > >> > >> If the db result for 123 does not exist I would like to throw a 404. > >> > >> Currently I'm using... > >> > >> Object onActivate(EventContext context) { > >> //db lookup code to prepare page > >> } > >> > >> Is the best way to throw a custom error that gets picked up by the > >> ExceptionReport page and "rendered" with a status code of 404? > >> > >> Or is there a way to initialize/prepare the page earlier in the cycle > >> and detect the non existence of resource 123? > >> > >> Thanks > >> Theo > >> > >> - > >> 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 > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Best regards, Igor Drobiazko http://tapestry5.de/blog
Re: 404 from onActivate
That's what I'm doing at the moment, but is not what I want. The result from the user's perspective is is a redirect 302 (or something) to a 404, which I don't think makes sense? On Fri, Mar 19, 2010 at 4:51 PM, Christian Riedel wrote: > I would create an Error404.java page and redirect to it in case your > onActivate doesn't find a corresponding entity. > > Am 19.03.2010 um 15:04 schrieb Mike Oestereter: > >> Hello >> >> I've got a page that takes the context as parameter to produce a >> result from db, e.g.: http:/hostname/app/page/123 >> >> If the db result for 123 does not exist I would like to throw a 404. >> >> Currently I'm using... >> >> Object onActivate(EventContext context) { >> //db lookup code to prepare page >> } >> >> Is the best way to throw a custom error that gets picked up by the >> ExceptionReport page and "rendered" with a status code of 404? >> >> Or is there a way to initialize/prepare the page earlier in the cycle >> and detect the non existence of resource 123? >> >> Thanks >> Theo >> >> - >> 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 > > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 404 from onActivate
I would create an Error404.java page and redirect to it in case your onActivate doesn't find a corresponding entity. Am 19.03.2010 um 15:04 schrieb Mike Oestereter: > Hello > > I've got a page that takes the context as parameter to produce a > result from db, e.g.: http:/hostname/app/page/123 > > If the db result for 123 does not exist I would like to throw a 404. > > Currently I'm using... > > Object onActivate(EventContext context) { > //db lookup code to prepare page > } > > Is the best way to throw a custom error that gets picked up by the > ExceptionReport page and "rendered" with a status code of 404? > > Or is there a way to initialize/prepare the page earlier in the cycle > and detect the non existence of resource 123? > > Thanks > Theo > > - > 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
404 from onActivate
Hello I've got a page that takes the context as parameter to produce a result from db, e.g.: http:/hostname/app/page/123 If the db result for 123 does not exist I would like to throw a 404. Currently I'm using... Object onActivate(EventContext context) { //db lookup code to prepare page } Is the best way to throw a custom error that gets picked up by the ExceptionReport page and "rendered" with a status code of 404? Or is there a way to initialize/prepare the page earlier in the cycle and detect the non existence of resource 123? Thanks Theo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org