You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Bocko <bo...@bitsyu.net> on 2005/03/31 12:46:28 UTC

Page redirect from pageBeginRender method?

Hi,

Problem is that my component could not throw pageRedirectException or use cycle.activate("page") in method pageBeginRender. How could I go to other page from this method. (I need to go to error page from this method in my app)

Longer explanation:
I have 2 components (that I developed) in page. The result I want is that when user click on link in first component (DirectLink) the other component will show data based on received data from first component. and some manipulation. Component dose this manipulation in method pageBeginRender() - and if there is some error I can't move to my error page.
If component do this manipulation in method pageValidate, then component will not have any data to show because, setting of data (from DirectLink) happens after this method was called. Result is that display of data is always one click late. When user click second time on the link, then the data from the first time is displayed.
Component passed data to each other by Visit object.

Thanks
Bogdan.

Re: Page redirect from pageBeginRender method?

Posted by Bocko <bo...@bitsyu.net>.
> Your stack trace shows that you're redirecting from one page (page1) to
> another page (page2) and then in the pageBeginRender() you try to redirect
> to yet another page (page3). Why is that? Can you avoid this and
> just redirect to the right page?

Actually, I stay on same page (it is like click on next page in Table
component),  but in the middle I do some data manipulation and in this
manipulation error happened. I wont to display this error to user, that's
why, there is redirection to page3.
I have looked to Tapestry source and found that render() in RequestCycle
class is surround width try-catch so any exception will be cought and
display as Tapestry ApplicationRuntimeException.

So I decide that solution for this is that I change default exception page
width my exception page. I already find examples for this.

Thanks for your time.
Bogdan


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


Re: Page redirect from pageBeginRender method?

Posted by Kent Tong <ke...@cpttm.org.mo>.
Your stack trace shows that you're redirecting from one page (page1) to
another page (page2) and then in the pageBeginRender() you try to redirect
to yet another page (page3). Why is that? Can you avoid this and
just redirect to the right page?



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


Re: Page redirect from pageBeginRender method?

Posted by Bocko <bo...@bitsyu.net>.
 From: "Kent Tong" <ke...@cpttm.org.mo>
To: <ta...@jakarta.apache.org>
Sent: Friday, April 01, 2005 3:50 AM
Subject: Re: Page redirect from pageBeginRender method?
 
> Show us the content of the exception page.
>
>
>

An exception has occurred. 
You may continue by restarting the session. 

      org.apache.tapestry.PageRedirectException 
      ReportErrorPage 
      Stack Trace: 
        a.. com.dynamis.rf.engine.report.ReportUtil.showException(ReportUtil.java:332) 
        b.. com.dynamis.rf.util.tapestry.contrib.form.RfForm.pageBeginRender(RfForm.java:248) 
        c.. com.dynamis.rf.util.tapestry.AbstractPage.firePageBeginRender(AbstractPage.java:464) 
        d.. com.dynamis.rf.util.tapestry.AbstractPage.renderPage(AbstractPage.java:294) 
        e.. org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:371) 
        f.. org.apache.tapestry.engine.AbstractEngine.renderResponse(AbstractEngine.java:732) 
        g.. org.apache.tapestry.engine.AbstractEngine.handlePageRedirectException(AbstractEngine.java:1026) 
        h.. org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:882) 
        i.. org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197) 
        j.. org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:326) 
        k.. javax.servlet.http.HttpServlet.service(HttpServlet.java:709) 
        l.. javax.servlet.http.HttpServlet.service(HttpServlet.java:802) 
        m.. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) 
        n.. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) 
        o.. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) 
        p.. org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) 
        q.. org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) 
        r.. org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) 
        s.. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) 
        t.. org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) 
        u.. org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) 
        v.. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) 
        w.. org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) 
        x.. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) 
        y.. org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) 
        z.. org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) 
        aa.. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
        ab.. org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) 
        ac.. org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) 
        ad.. org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) 
        ae.. org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) 
        af.. org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) 
        ag.. org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) 
        ah.. org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) 
        ai.. org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) 
        aj.. java.lang.Thread.run(Thread.java:534) 
     


Re: Page redirect from pageBeginRender method?

Posted by Kent Tong <ke...@cpttm.org.mo>.
Bocko <bogi <at> bitsyu.net> writes:

> In this case
> this exception is treated as ordinary exception not PageRedirect, and is
> shown on Tapestry exception page.

Show us the content of the exception page.


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


Re: Page redirect from pageBeginRender method?

Posted by Bocko <bo...@bitsyu.net>.
Hi,

 I throw pageRedirectException but it is caught somewhere in Tapestry lower
layers and displayed as usual Tapestry's Exception page width data:
PageRedirectExecption and name of my error page that I throw. In this case
this exception is treated as ordinary exception not PageRedirect, and is
shown on Tapestry exception page.

Bogdan.


----- Original Message ----- 
From: "Markus Eberle" <ma...@tngtech.com>
To: <ta...@jakarta.apache.org>
Sent: Thursday, March 31, 2005 1:59 PM
Subject: Re: Page redirect from pageBeginRender method?


> Hi,
>
> what about throwing a [Page]RedirectException?
> This should solve your problem.
>
> Bis denne dann,
> Markus
>
> On Thursday 31 March 2005 12:46, Bocko wrote:
> > Hi,
> >
> > Problem is that my component could not throw pageRedirectException or
use cycle.activate("page") in method pageBeginRender. How could I go to
other page from this method. (I need to go to error page from this method in
my app)
> >
> > Longer explanation:
> > I have 2 components (that I developed) in page. The result I want is
that when user click on link in first component (DirectLink) the other
component will show data based on received data from first component. and
some manipulation. Component dose this manipulation in method
pageBeginRender() - and if there is some error I can't move to my error
page.
> > If component do this manipulation in method pageValidate, then component
will not have any data to show because, setting of data (from DirectLink)
happens after this method was called. Result is that display of data is
always one click late. When user click second time on the link, then the
data from the first time is displayed.
> > Component passed data to each other by Visit object.
> >
> > Thanks
> > Bogdan.
> >
>
> -- 
> TNG Technology Consulting GmbH
> Tel: +49 179 148 24 16
> markus.eberle@tngtech.com
> http://www.tngtech.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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


Re: Page redirect from pageBeginRender method?

Posted by Markus Eberle <ma...@tngtech.com>.
Hi,

what about throwing a [Page]RedirectException?
This should solve your problem.

Bis denne dann,
	Markus

On Thursday 31 March 2005 12:46, Bocko wrote:
> Hi,
> 
> Problem is that my component could not throw pageRedirectException or use cycle.activate("page") in method pageBeginRender. How could I go to other page from this method. (I need to go to error page from this method in my app)
> 
> Longer explanation:
> I have 2 components (that I developed) in page. The result I want is that when user click on link in first component (DirectLink) the other component will show data based on received data from first component. and some manipulation. Component dose this manipulation in method pageBeginRender() - and if there is some error I can't move to my error page.
> If component do this manipulation in method pageValidate, then component will not have any data to show because, setting of data (from DirectLink) happens after this method was called. Result is that display of data is always one click late. When user click second time on the link, then the data from the first time is displayed.
> Component passed data to each other by Visit object.
> 
> Thanks
> Bogdan.
> 

-- 
TNG Technology Consulting GmbH
Tel: +49 179 148 24 16
markus.eberle@tngtech.com
http://www.tngtech.com

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