Ian Boston wrote:
IMHO the sling:include processing looks correct, and the GET processing
looks wrong.
I had always used the rule, perhaps incorrectly that the:
Resource URI was the path upto and not including the first . in the last
path element
Hmm, I think this description makes a suffix completely non-existent.
The unit tests assert the first period ends the request path.
The rules under "Request Processing" at:
http://sling.apache.org/site/sling-api.html say that the request path is
the longest substring resolving to a resource that is either the
complete request URL, or the next character is either a dot (beginning
of selectors and extension) or a slash (beginning of suffix).
Is the sling-api.html documentation I sited above out-dated? This is the
2nd time I've run into unexpected issues due to that documentation not
being how it works. I'm not sure if it's the documentation that's wrong,
or if there are bugs in the URL breakdown.
which should make the resource
ie
resourcePath: /content/resource./mysuffix
extension: html
selectors: null
suffix: null
I notice the . has gone from the include, was that intentional or a typo ?
That was intentional. It looks like the include wipes out the '.', and
resolves the full request path without it.
Best,
Branden
Ian
On 25 Aug 2009, at 16:12, Branden Visser wrote:
Hi everyone,
I found some inconsistency between URL processing in sling.include and
a URL processed in an HTTP GET request.
If I do an HTTP request for the following:
/content/resource./mysuffix.html
The request is processed as:
resourcePath: /content/resource
extension: null
selectors: null
suffix: /mysuffix.html
Whereas if I do:
sling.include(/content/resource./mysuffix.html), what I get is:
resourcePath: /content/resource/mysuffix
extension: html
selectors: null
suffix: null
Judging solely by the assertions in the RPI unit test [1], the HTTP
request URL decomposition is correct, and the sling.include handler
has a bug. Unless a sling include is *not* supposed to be synonymous
with a GET request?
Best,
Branden
[1]
http://svn.apache.org/repos/asf/sling/trunk/bundles/engine/src/test/java/org/apache/sling/engine/impl/request/SlingRequestPathInfoTest.java