If you want to send a client-side redirect, throw a RedirectException.
This is why you see a second request, it how client redirects work. 
The user will see the new URL in their browser (as opposed to a
server-side forward, which doesn't cause a second request).

If you need to hold onto some information, store it in persistent properties.



On 2/7/06, Gerald Schöffel <[EMAIL PROTECTED]> wrote:
> Hmmm ... after adding tons of debug-info to my code, I currently found out, 
> why this behaviour occurs.
>
> ExternalCallback.performCallback(IRequestcycle) is calling 
> activateExternalPage directly (like mentioned in the docs) - without the 
> chance to do a validation again (in contrast to the doc of 
> IExternalPage.activateExternalPage) :( Ok, the page is validated once - but 
> it would be great to get a second chance :)
>
> Even worth: after activateExternalPage is invoked and the listener ends, a 
> new thread seems to be started (assuming my log-file is in sync - could be a 
> timing problem to log those events) ?
>
> So I have no chance to get to the parameters with the help of my threaded 
> ParamterStorage service included in every IExternalPage I use :(
>
> So I am clueless again - I do not now, where to intercept this render-process 
> to switch to another scheme ... anybody has an idea ?
>
> Thanks,
> Gerald
>
> >
> >Hi Ivano,
> >
> >thank you for your reply.
> >
> >I am using Tapestry 4.0.
> >
> >I need the absolute url, because I want to forward (based on security
> >constraints of the page (or one of the containing components) currently
> >rendered) to the right scheme.
> >
> >Because I noticed, that getRequestCycle() is not the right place to find
> >the service needed for the current page in, I am currently checking with
> >'if (getPage() instanceof IExternalPage) ...' in the pageValidate method.
> >
> >But I think I am at the wrong place to do it (pageValidate), because
> >after getting things to work, the parameters of the external page are
> >gone :(
> >
> >It is sooooooo frustrating ... this could be the perfect security
> >'framework' for me. Everything was working fine (transparent forwarding
> >to https/http/login page whenevever the app needs it) until the
> >different services where involved :(
> >
> >Maybe someone could give me a hint, where to intercept the response
> >rendering to forward to a different scheme is the best place for.
> >
> >Here is a commented excerpt from the logfile to make things clear ...
> >
> >External page is called from the browser (needs login):
> >
> >validate begin --------------------------------
> >validate:page   :MyExternalPage
> >validate:service:external
> >validate:scheme :http
> >login needed !
> >external callback stored
> >redirect to login page (throw new PageRedirectException(getLoginPage()))
> >
> >login page is marked to need https ....
> >
> >validate begin --------------------------------
> >validate:page   :secure/Login
> >validate:service:external   (!!!!) I am still in the same requestCylce ?
> >validate:scheme :http
> >wrong scheme, switching to https
> >normal page, building url   (instanceof IExternalPage ...)
> >webRequest.forward(https-url)
> >validate end --------------------------------
> >
> >OK, now the scheme is https:
> >
> >validate begin --------------------------------
> >validate:page   :secure/Login
> >validate:service:page
> >validate:scheme :https
> >validate end --------------------------------
> >
> >form is submitted:
> >
> >validate begin --------------------------------
> >validate:page   :secure/Login
> >validate:service:direct
> >validate:scheme :https
> >validate end --------------------------------
> >
> >listener is called:
> >
> >doLogin starts <- listener bound to submit
> >
> >login was OK, activating Callback (the EXTERNAL one stored above)
> >getCallback().performCallback(getRequestCycle())
> >
> >validate begin --------------------------------
> >validate:page   :MyExternalPage
> >validate:service:direct                (!!!!!)  :(
> >validate:scheme :https
> >scheme wrong, switching to http
> >external page, building url    (instanceof IExternalPage ...)
> >
> >build url with:
> >ExternalServiceParameter eparams = new
> >ExternalServiceParameter(getPage().getPageName(),
> >getRequestCycle().getListenerParameters()) ;
> >link = getExternalService().getLink(false, eparams).getAbsoluteURL() ;
> >
> >webRequest.forward(http-url) (**1**)
> >validate end --------------------------------
> >doLogin ends
> >
> >Then a NullPointerException is thrown, because the url I have forwarded
> >to in (**1**) does not contain the parameters from the original external
> >service, so activateExternalPage is throwing this exception :(
> >
> >Any ideas ?
> >
> >Thanks again !
> >
> >Gerald
> >
> >Ivano wrote:
> >> Why do you need to build the url? What Tapestry version are you using?
> >>
> >> Ivano Pagano.
> >>
> >> Gerald Schöffel wrote:
> >>
> >
> >
> >---------------------------------------------------------------------
> >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]
>
>


--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to