Re: SSL and appendToResponse
Re: SSL and appendToResponse
- Subject: Re: SSL and appendToResponse
- From: Merul Patel <email@hidden>
- Date: Mon, 26 Apr 2004 13:53:12 +0100
I hope you're not using the WORedirect Dynamic Element in WOBuilder.
I've not used this before, and I don't know its correct application. I
just use WORedirect instead of WOComponent as the return type in my
component or direct action.
Assume for sake of discussion that your secure component URL is of the
form "https://www.myserver.com/cgi-bin/WebObjects/test.woa/Login" and
that you want to return the WORedirect from a Direct Action class to
another direct action callled 'secondAction' in a separate 'second'
class file, then using the following would do this:
WORedirect nextPage = (WORedirect) pageWithName("WORedirect");
String url = context().completeURLWithRequestHandlerKey("wa",
"second/secondAction", null, false, 0);
nextPage.setUrl(url);
return nextPage;
The WOContext. completeURLWithRequestHandlerKey() method, will return
"http://www.myserver.com/cgi-bin/WebObjects/test.woa/second/second" I
believe. Chuck out the string to System.out for yourself and have a
play with the method, but note the main thing is that the fourth
parameter indicates whether to return a secure or insecure URL.
HTH.
Mezza
On 26 Apr 2004, at 12:00, Jonathan Fleming wrote:
Hi Merul,
Thanks for your reply, I did this but I have got into the problem I
had when I was first trying to create a https connection and that is a
repetitive loop. I believe this is because the redirect is redirecting
to itself. If I use any other url your code works perfectly, so does
anyone know a solution to this. I tried to reverse the process of
checking whether I was in https to then get back to http, but I must
be doing something wrong.
I have found that if I manually set the href binding in the
component's .wod file through WOBuilder, again this works fine too,
but doing this would mean creating a String in every component to use
as the my action so-to-speak.
How can I use my directAction to do this? IT's possible it's a simple
answer but my brain is so fried with the amount of information i've
been reading on how to get IIS working with SSL in a single machine
that I simply can't think straight... not that I can normally ;^)
Thanks for any pointers
Jonathan :^)
From: Merul Patel <email@hidden>
To: email@hidden
Subject: Re: SSL and appendToResponse
Date: Sat, 24 Apr 2004 09:44:50 +0100
The easiest way I've found is to use WORedirect.
You can use something like the following within either a component
action or a direct action:
WORedirect nextPage = (WORedirect) pageWithName("WORedirect");
nextPage.setUrl(url);
return nextPage;
To set the 'url' string you can either declare it statically if you
don't need to preserve and session ids, or use the
WOContext.completeURLWithRequestHandlerKey() or
WOContext.urlWithRequestHandlerKey() methods if you want to preserve
sessions and other context information.
Mezza
Once i'm in a SSL (https) how do I get back to non secure layer
(http)?
Nothing I do will take me back to normal browsing... I've been
reading these
http://www.wodeveloper.com/omniLists/webobjects-dev/2002/July/
msg00303.html
subject: SSL and appendToResponse - on wodeveloper.com
http://wodev.spearway.com/cgi-bin/WebObjects/WODev.woa/wa/Main?
wikiPage=DetectSSL
subject: DetectSSL - on wodev.com
and am managing to get into SSL OK but not out again when it's not
needed.
Any pointer will be appreciated
Jonathan :^)
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_________________________________________________________________
Use MSN Messenger to send music and pics to your friends
http://www.msn.co.uk/messenger
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.