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 "secure"
 } 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

--
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director

Reply via email to