Grzegorz Kossakowski wrote:
Reinhard Poetz pisze:
Hi Reinhard, isn't it a duplicate of https://issues.apache.org/jira/browse/COCOON-2044 ?
Not really. If I read that issue correctly, it talks about making cache keys unique. I refer to absolute servlet:/ URIs, e.g.

servlet:com.mycompany.project.servlet.service+:/test/foo/bar

In the discussion of COCOON-2044 it is mentioned that non-uniqueness of cache
keys is caused by bad implementation of servlet service because it returns
relative URIs instead of absolute ones when getURI() method is called. So in
order to fix COCOON-2044 you just need essentially to implement support of
absolute URI for servlet: protocol. That's why I see it as duplicate.

I've rewritten the ServletConnection and it always expects now globally absolute URIs. If a service-relative URI is being resolved, the ServletSource can translate it into an absolute one.

This should fix the cache key generation problem too.

Btw, after reading the URI spec and making some experiments with the URI class of Java, I figured out that the originally proposed "!" at the beginning of the sub schema is not allowed, however, appending a "+" is. This is required in order to distinguish between relative and absolute servlet:/ URIs.

Plus sign doesn't look naturally for me. Are there any other options?

Citing RFC 2396:

   Scheme names consist of a sequence of characters beginning with a
   lower case letter and followed by any combination of lower case
   letters, digits, plus ("+"), period ("."), or hyphen ("-").  For
   resiliency, programs interpreting URI should treat upper case letters
   as equivalent to lower case in scheme names (e.g., allow "HTTP" as
   well as "http").

      scheme        = alpha *( alpha | digit | "+" | "-" | "." )


But since I strongly discourage from using absolute URIs directly, I don't
consider it being a big issue.

--
Reinhard Pötz                            Managing Director, {Indoqa} GmbH
                          http://www.indoqa.com/en/people/reinhard.poetz/

Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member, PMC Chair        [EMAIL PROTECTED]
_________________________________________________________________________

Reply via email to