Thanks for the tip, Andreas, but three problems:
* pageValidate(..) does not have access to the rewind-phase. Sometimes there is work I only want to do -- or /not/ do -- in this phase, and I lose that control. * pageValidate(..) on PageA is called even when it's just a @DirectListener being called from PageA * pageValidate(..) on PageA is called when PageA is merely injected into another page, even if PageA is never actually used.

Those latter two issues are, obviously, slowing my application down.

So .. if not pageBeginRender(..) (because I can't do exception-possible work because I can't send the user to an ad hoc page via PageRedirectException) or pageValidate(..) (because it's called in two places where the page isn't actually ultimately rendered), I'm confused as to where I do the work to initialize a page with everything its template needs to display. I want all this logic encapsulated in the page itself, and not spread out to every page-listener that could forward to it.

Currently, I have page-listeners call an initializePage(..) method on the target page, which merely sets a few properties that my pageBeginRender/pageValidate methods would use to query all the necessary information out, and then the page-listener returns the initialized page for rendering. I think my plan now is to refactor all those initialization methods to do all the query-work themselves, and then return either the target page, or an initialized error page, which the page-listener will in turn return for rendering. That would gracefully handle the latter two issues above, but initialization work specific to the rewind phase is still lost to me.

Thanks,
Jim


Andreas Andreou wrote:
See the PageValidateListener interface

Implement that and move the redirect logic into
void pageValidate(PageEvent event);

On Wed, Aug 20, 2008 at 1:24 PM, Jim <[EMAIL PROTECTED]> wrote:
Hello,

I have PageA throwing a PageRedirectException to PageB in its
pageBeginRender, and PageB throwing a PageRedirectException to PageC in its
pageBeginRender.  However, PageB's PageRedirectException is resulting in the
Tapestry exception-page, without trying to render PageC -- the
exception-report lists only "org.apache.tapestry.PageRedirectException" and
its stacktrace as the problem.

My expectation was that Tapestry would keep passing the baton from page to
page until one rendered -- is that not the intention?

Here's the stacktrace below where the PageRedirectException was thrown:

org.apache.tapestry.AbstractPage.firePageBeginRender(AbstractPage.java:409)
org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:244)
org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:400)
org.apache.tapestry.services.impl.DefaultResponseBuilder.renderResponse(DefaultResponseBuilder.java:159)
org.apache.tapestry.services.impl.ResponseRendererImpl.renderResponse(ResponseRendererImpl.java:33)
$ResponseRenderer_11bdf8e6cf5.renderResponse($ResponseRenderer_11bdf8e6cf5.java)
org.apache.tapestry.engine.AbstractEngine.renderResponse(AbstractEngine.java:201)
org.apache.tapestry.engine.AbstractEngine.handlePageRedirectException(AbstractEngine.java:329)
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:245)
org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:54)
$WebRequestServicer_11bdf8e6d3d.service($WebRequestServicer_11bdf8e6d3d.java)
org.apache.tapestry.services.impl.DisableCachingFilter.service(DisableCachingFilter.java:54)
$WebRequestServicerFilter_11bdf8e6d3f.service($WebRequestServicerFilter_11bdf8e6d3f.java)
$WebRequestServicer_11bdf8e6d41.service($WebRequestServicer_11bdf8e6d41.java)
$WebRequestServicer_11bdf8e6d39.service($WebRequestServicer_11bdf8e6d39.java)
org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:61)
$ServletRequestServicer_11bdf8e6d1d.service($ServletRequestServicer_11bdf8e6d1d.java)
org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
$ServletRequestServicerFilter_11bdf8e6d1f.service($ServletRequestServicerFilter_11bdf8e6d1f.java)
$ServletRequestServicer_11bdf8e6d21.service($ServletRequestServicer_11bdf8e6d21.java)
org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
$ServletRequestServicerFilter_11bdf8e6d1b.service($ServletRequestServicerFilter_11bdf8e6d1b.java)
$ServletRequestServicer_11bdf8e6d21.service($ServletRequestServicer_11bdf8e6d21.java)
org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
$ServletRequestServicerFilter_11bdf8e6d19.service($ServletRequestServicerFilter_11bdf8e6d19.java)
$ServletRequestServicer_11bdf8e6d21.service($ServletRequestServicer_11bdf8e6d21.java)
$ServletRequestServicer_11bdf8e6d13.service($ServletRequestServicer_11bdf8e6d13.java)
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:126)
org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:103)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:810)

Thanks,
Jim

---------------------------------------------------------------------
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]

Reply via email to