It sounds like what you're saying is that you want all links on an
un-secure page to be built http, and all links on a secure page to be
built https. This can be handy for stuff like images in a page that
might be accessed via http OR https and you need the image URLs to be
secure or un-secure so browsers don't complains about un-secure content.
I'm not positive if CB 3 has a better way to solve that, but in 2.6.3 I
handled it by implementing a request context decorator that replaced the
buildLink method to build all links using the same prototcol that the
main event was being accessed with.
Of course, I will have an SSL interceptor that bounces you back and
forth to and from SSL where necessary.
Yes, what Brad said is what I'm looking for. It makes more sense to me
to have all the links on a https page also be https by default. Then,
have the SSL interceptor take care of relocating to http if https is
not needed on a linking page.
This alleviates having to add Event.setSESBaseURL("https:// #cgi.HTTP_HOST#") to every handler file that needs SSL, or having to
add ssl=true to the buildLink method.
I believe it would also allow you to use relative links if you wanted
to (?), like:
<form name="Login" method="post" action="/security/dologin">
You can at preProcess, depending on the event decide if all your links should be built with ssl or not. You do this by overriding the base url with event.setSESBaseURL(). Then when you want a-la-carte links to be built WITHOUT ssl, you use the buildLink() arguments of baseURL
event.buildLink(linkTo="", baseURL=“URL with no SSL”)