[prev in list] [next in list] [prev in thread] [next in thread]
List: tapestry-user
Subject: Re: Changing Scheme and Port in the listener code
From: Paul Ferraro <pmf8 () columbia ! edu>
Date: 2004-09-28 20:06:55
Message-ID: 4159C45F.9070905 () columbia ! edu
[Download RAW message or body]
A servlet request is read-only. To make the HTTPS -> HTTP transition
will require a redirect.
e.g.
public void loginSubmit(IRequestCycle cycle)
{
// login logic
RequestContext request = cycle.getRequestContext();
ILink link =
cycle.getEngine().getService(Tapestry.PAGE_SERVICE).getLink(cycle,
cycle.getPage(), new String[] { "Home" });
throw new RedirectException(link.getAbsoluteURL("http",
request.getServerName(), 80, null, true));
}
In my own applications I use a custom RedirectException implementation
(I posted it a while back) that aims to encapsulate this type of url
generation logic.
Paul
Vladimir Drndarski wrote:
>Is there any way to change the Scheme and Port in code?
>
>For example, I have a Login page that is secure. Once the user logs in
>there is no longer a need to use SSL and I'd like to switch back to HTTP
>instead of HTTPS in the requestCycle.
>
>
> public void loginSubmit(IRequestCycle cycle) {
> ...
> {Do login stuff}
> ...
>
> cycle.activate("Home");
> }
>
>The above code leaves the user in secure mode and I don't see how to change
>that.
>
>I see that you can fetch the Scheme using:
>
> cycle.getRequestContext().getScheme();
>
>but how do you set it?
>
>
>Thanks,
>
>Vladimir
>
>---------------------------------------------------------------------
>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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic