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]