You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Norman Franke <no...@myasd.com> on 2007/11/06 00:10:38 UTC

Changing from https and http

I have a Tapestry 4.1.3 form that I submit via https (using the port  
and scheme parameters for the form.) This seems to work great.

However, I then want to switch back to plain old http. While I can  
throw a redirect exception with an external URL, this doesn't  
preserve page state. In my case, if the user entered incorrect  
information, I need to display a message which is then lost.

How can I get Tapestry to return a normal http version after the  
submit (currently I'm just returning null from my listener)?

Norman Franke
ASD, Inc.



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


Re: Changing from https and http

Posted by Kevin Menard <km...@servprise.com>.
I've found the whole scheme/port parameters just too much of a pain in the
neck to work with.  In an ideal world, you'd be able to tag a page class as
@Secure and it would automatically do the correct thing with regards to
scheme.

What I've resorted to is using mod_rewrite rules that handle the scheme
rewriting.  It's not ideal and has exploded fantastically in my face before,
but generally works once you get things going.

-- 
Kevin


On 11/6/07 11:55 AM, in article
9C2E1C01-98C6-4E37-BB0E-3D0749723185@myasd.com, "Norman Franke"
<no...@myasd.com> wrote:

> I didn't hear anything on this. At first, I tried creating a
> DirectLink component and set its scheme and port and then return an
> ILink from that from my form listeners. However, despite setting
> scheme to http, it ignores the scheme and stays https.
> 
> So, I then decided to just throw a RedirectException with the
> rendered URL like this:
> 
> link.getAbsoluteURL("http", null, 80, null, true);
> 
> That seems to work. Good idea, bad idea? Why didn't returning the
> ILink with a scheme of http work?
> 
> Norman Franke
> ASD, Inc.



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


Re: Changing from https and http

Posted by Norman Franke <no...@myasd.com>.
This is an odd one. Apparently, this technique doesn't work either.  
After loggin in via HTTPS, I can switch back to normal http. This is  
all done outside of Tapestry. Things get interesting, however, once I  
go to a tapestry page. I have a page with a a contrib:table. It will  
display properly (non-https). However, clicking on the "2" for page  
two apparently creates a new session ID (which is now invalid.) If I  
then go back to my app's main page (again, non tapestry) and print  
out the cookies, I can see another JSESSIONID cookie has been added  
somehow.

I do take the original JSESSIONID cookie (from the login https)  
session and add it (setting setSecure(false)) to the new standard  
http session, which seems to work until Tapestry gets involved.

Any ideas?

It seems rather common to switch between secure and non-secure, but  
Tapestry just doesn't seem able to handle it. Am I missing something?

Norman Franke
ASD, Inc.


On Nov 6, 2007, at 11:55 AM, Norman Franke wrote:

> I didn't hear anything on this. At first, I tried creating a  
> DirectLink component and set its scheme and port and then return an  
> ILink from that from my form listeners. However, despite setting  
> scheme to http, it ignores the scheme and stays https.
>
> So, I then decided to just throw a RedirectException with the  
> rendered URL like this:
>
> 	link.getAbsoluteURL("http", null, 80, null, true);
>
> That seems to work. Good idea, bad idea? Why didn't returning the  
> ILink with a scheme of http work?
>
> Norman Franke
> ASD, Inc.
>
> On Nov 5, 2007, at 6:10 PM, Norman Franke wrote:
>
>> I have a Tapestry 4.1.3 form that I submit via https (using the  
>> port and scheme parameters for the form.) This seems to work great.
>>
>> However, I then want to switch back to plain old http. While I can  
>> throw a redirect exception with an external URL, this doesn't  
>> preserve page state. In my case, if the user entered incorrect  
>> information, I need to display a message which is then lost.
>>
>> How can I get Tapestry to return a normal http version after the  
>> submit (currently I'm just returning null from my listener)?
>>
>> Norman Franke
>> ASD, Inc.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>



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


Re: Changing from https and http

Posted by Norman Franke <no...@myasd.com>.
I didn't hear anything on this. At first, I tried creating a  
DirectLink component and set its scheme and port and then return an  
ILink from that from my form listeners. However, despite setting  
scheme to http, it ignores the scheme and stays https.

So, I then decided to just throw a RedirectException with the  
rendered URL like this:

	link.getAbsoluteURL("http", null, 80, null, true);

That seems to work. Good idea, bad idea? Why didn't returning the  
ILink with a scheme of http work?

Norman Franke
ASD, Inc.

On Nov 5, 2007, at 6:10 PM, Norman Franke wrote:

> I have a Tapestry 4.1.3 form that I submit via https (using the  
> port and scheme parameters for the form.) This seems to work great.
>
> However, I then want to switch back to plain old http. While I can  
> throw a redirect exception with an external URL, this doesn't  
> preserve page state. In my case, if the user entered incorrect  
> information, I need to display a message which is then lost.
>
> How can I get Tapestry to return a normal http version after the  
> submit (currently I'm just returning null from my listener)?
>
> Norman Franke
> ASD, Inc.



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