cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: Protocol switch in portals
Date Tue, 20 Sep 2005 16:08:31 GMT
Carsten Ziegeler wrote:

>Sylvain Wallez wrote:
>>You got me wrong: I haven't said that we should not care about jsr168 
>>and wsrp, but that people that don't use it should not be asked to take 
>>care about deployment issues (ProxyPreserveHost et al) that are 
>>specifically related to these features.
>As soon as you want to switch to https for any forms in your portlets
>you need it, for example if you use cforms to build them.

You're right: a working getServerName() is actually needed as soon as we 
want to switch protocols. But that only happens on sites mixing http and 
https for urls served by Cocoon, which isn't always the case.

>>In DefaultLinkService.getInfo() : add a "Boolean secure" parameter and then
>>  if (secure != null) {
>>    // absolutize using either http or https depending on the value of 
>>  } else {
>>    // do not absolutize
>>  }
>>Isn't it just what is needed?
>Hmm, I'm not sure - I think we should compare the current protocol with
>the protocol request and if they're not equal use absolute urls, no?

Sorry: what do you mean by "current protocol" and "protocol request"? I 
guess it's "the protocol of the current request" and "the protocol asked 
for by the caller of getLinkURI()"?

That should be something like:
  String proto;
  if (secure == null) {
      proto = request.scheme();
  } else {
      proto = secure.booleanValue() ? "https" : "http";

  if (proto.equals(request.getScheme()) {
      // same scheme: do not absolutize
  } else {
      // different scheme: absolutize

This actually filters more cases where absolutizing will effectively 
happen, which I like :-)


Sylvain Wallez                        Anyware Technologies
Apache Software Foundation Member     Research & Technology Director

View raw message