You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by anjan <po...@gmail.com> on 2013/11/07 12:00:34 UTC
Resource resolution
Hi, I am having an issue and need expert's advice.
>From Sling's admin console, "Sling Resource Resolver" tab, when I try to
resolve the path "http://localhost:8080/content/test/sub-test/abc;abc", I
get the response as
*JcrNodeResource, type=sling:Folder, superType=null,
path=/content/test/sub-test/abc;abc* which is correct.
But when I try to use the URL
http://localhost:8080/content/test/sub-test/abc;abc.browser.children.json, I
get 404 error with the below request tracking. Please see the PathInfo
value. It shows "/content/test/sub-test/abc" instead of
"/content/test/sub-test/abc;abc". Is it something to do with the character
"*;*"?
---------------------------
The requested URL /content/test/sub-test/abc;abc.browser.children.json
resulted in an error in
org.apache.sling.servlets.resolver.internal.defaults.DefaultErrorHandlerServlet.
Request Progress:
0 (2013-11-07 15:41:30) TIMER_START{Request Processing}
0 (2013-11-07 15:41:30) COMMENT timer_end format is {<elapsed
msec>,<timer name>} <optional message>
0 (2013-11-07 15:41:30) LOG Method=GET,
*PathInfo=/content/test/sub-test/abc*
0 (2013-11-07 15:41:30) TIMER_START{ResourceResolution}
4 (2013-11-07 15:41:30) TIMER_END{4,ResourceResolution}
URI=/content/test/sub-test/abc;abc.browser.children.json resolves to
Resource=NonExistingResource, path=/content/test/sub-test/abc
4 (2013-11-07 15:41:30) LOG Resource Path Info: SlingRequestPathInfo:
path='/content/test/sub-test/abc', selectorString='null', extension='null',
suffix='null'
4 (2013-11-07 15:41:30) TIMER_START{ServletResolution}
4 (2013-11-07 15:41:30)
TIMER_START{resolveServlet(NonExistingResource,
path=/content/test/sub-test/abc)}
12 (2013-11-07 15:41:30)
TIMER_END{8,resolveServlet(NonExistingResource,
path=/content/test/sub-test/abc)} Using servlet
org.apache.sling.servlets.get.DefaultGetServlet
12 (2013-11-07 15:41:30) TIMER_END{8,ServletResolution}
URI=/content/test/sub-test/abc;abc.browser.children.json handled by
Servlet=org.apache.sling.servlets.get.DefaultGetServlet
12 (2013-11-07 15:41:30) LOG Applying Requestfilters
12 (2013-11-07 15:41:30) LOG Calling filter:
org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter
12 (2013-11-07 15:41:30) LOG Calling filter:
com.praxeva.wsmlite.filter.AuthenticationFilter
12 (2013-11-07 15:41:30)
TIMER_START{org.apache.sling.servlets.get.DefaultGetServlet#0}
24 (2013-11-07 15:41:30)
TIMER_END{12,org.apache.sling.servlets.get.DefaultGetServlet#0}
25 (2013-11-07 15:41:30) TIMER_START{handleError:status=404}
27 (2013-11-07 15:41:30) TIMER_END{2,handleError:status=404} Using
handler
org.apache.sling.servlets.resolver.internal.defaults.DefaultErrorHandlerServlet
29 (2013-11-07 15:41:30) TIMER_END{29,Request Processing} Dumping
SlingRequestProgressTracker Entries
ApacheSling/2.2 (Apache Tomcat/6.0.32, Java HotSpot(TM) 64-Bit Server VM
1.6.0_23, Linux 3.5.0-42-generic amd64)
--
View this message in context: http://apache-sling.73963.n3.nabble.com/Resource-resolution-tp4028847.html
Sent from the Sling - Users mailing list archive at Nabble.com.
Re: Resource resolution
Posted by anjan <po...@gmail.com>.
Hi Bertrand, apart from other properties, I also see the below output for
http://localhost:8080/content/test/sub-test.tidy.2.json
"abc;abc": {
"jcr:createdBy": "admin",
"jcr:created": "Thu Nov 07 2013 15:41:28 GMT+0530",
"jcr:primaryType": "sling:Folder"
}
--
View this message in context: http://apache-sling.73963.n3.nabble.com/Resource-resolution-tp4028847p4028888.html
Sent from the Sling - Users mailing list archive at Nabble.com.
Re: Resource resolution
Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,
On Thu, Nov 7, 2013 at 12:00 PM, anjan <po...@gmail.com> wrote:
> ...when I try to use the URL
> http://localhost:8080/content/test/sub-test/abc;abc.browser.children.json, I
> get 404 error with the below request tracking. Please see the PathInfo
> value. It shows "/content/test/sub-test/abc" instead of
> "/content/test/sub-test/abc;abc".
What's the output of http://localhost:8080/content/test/sub-test.tidy.2.json ?
-Bertrand
Re: Resource resolution
Posted by Bertrand Delacretaz <bd...@apache.org>.
On Thu, Nov 7, 2013 at 12:32 PM, Robert Munteanu <ro...@lmn.ro> wrote:
> ...The ';' character has a special role in HTTP - it can be used as a
> query separator under certain circumstances...
That's indeed the root cause here, you need to escape ; to %3B in
URLs, see http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
for example.
If you don't do this the ;abc is already eaten by the Jetty server
that the Sling launchpad embeds.
OTOH the following works:
$ curl -u admin:admin -F"jcr:primaryType=sling:Folder" -Ftitle=testing
"http://localhost:8080/content/test/sub-test/abc%3Babc"
...
$ curl http://localhost:8080/content/test/sub-test.tidy.2.json
{
"jcr:primaryType": "nt:unstructured",
"abc;abc": {
"title": "testing",
"jcr:createdBy": "admin",
"jcr:created": "Mon Nov 11 2013 12:10:54 GMT+0100",
"jcr:primaryType": "sling:Folder"
}
}
$curl http://localhost:8080/content/test/sub-test/abc%3Babc.tidy.json
{
"title": "testing",
"jcr:createdBy": "admin",
"jcr:created": "Mon Nov 11 2013 12:10:54 GMT+0100",
"jcr:primaryType": "sling:Folder"
}
-Bertrand
Re: Resource resolution
Posted by Robert Munteanu <ro...@lmn.ro>.
On Thu, Nov 7, 2013 at 1:00 PM, anjan <po...@gmail.com> wrote:
> Hi, I am having an issue and need expert's advice.
>
> From Sling's admin console, "Sling Resource Resolver" tab, when I try to
> resolve the path "http://localhost:8080/content/test/sub-test/abc;abc", I
> get the response as
> *JcrNodeResource, type=sling:Folder, superType=null,
> path=/content/test/sub-test/abc;abc* which is correct.
>
> But when I try to use the URL
> http://localhost:8080/content/test/sub-test/abc;abc.browser.children.json, I
> get 404 error with the below request tracking. Please see the PathInfo
> value. It shows "/content/test/sub-test/abc" instead of
> "/content/test/sub-test/abc;abc". Is it something to do with the character
> "*;*"?
The ';' character has a special role in HTTP - it can be used as a
query separator under certain circumstances [1] . This might be the
root cause of your problems.
Robert
[1]: http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2
>
> ---------------------------
>
> The requested URL /content/test/sub-test/abc;abc.browser.children.json
> resulted in an error in
> org.apache.sling.servlets.resolver.internal.defaults.DefaultErrorHandlerServlet.
> Request Progress:
>
> 0 (2013-11-07 15:41:30) TIMER_START{Request Processing}
> 0 (2013-11-07 15:41:30) COMMENT timer_end format is {<elapsed
> msec>,<timer name>} <optional message>
> 0 (2013-11-07 15:41:30) LOG Method=GET,
> *PathInfo=/content/test/sub-test/abc*
> 0 (2013-11-07 15:41:30) TIMER_START{ResourceResolution}
> 4 (2013-11-07 15:41:30) TIMER_END{4,ResourceResolution}
> URI=/content/test/sub-test/abc;abc.browser.children.json resolves to
> Resource=NonExistingResource, path=/content/test/sub-test/abc
> 4 (2013-11-07 15:41:30) LOG Resource Path Info: SlingRequestPathInfo:
> path='/content/test/sub-test/abc', selectorString='null', extension='null',
> suffix='null'
> 4 (2013-11-07 15:41:30) TIMER_START{ServletResolution}
> 4 (2013-11-07 15:41:30)
> TIMER_START{resolveServlet(NonExistingResource,
> path=/content/test/sub-test/abc)}
> 12 (2013-11-07 15:41:30)
> TIMER_END{8,resolveServlet(NonExistingResource,
> path=/content/test/sub-test/abc)} Using servlet
> org.apache.sling.servlets.get.DefaultGetServlet
> 12 (2013-11-07 15:41:30) TIMER_END{8,ServletResolution}
> URI=/content/test/sub-test/abc;abc.browser.children.json handled by
> Servlet=org.apache.sling.servlets.get.DefaultGetServlet
> 12 (2013-11-07 15:41:30) LOG Applying Requestfilters
> 12 (2013-11-07 15:41:30) LOG Calling filter:
> org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter
> 12 (2013-11-07 15:41:30) LOG Calling filter:
> com.praxeva.wsmlite.filter.AuthenticationFilter
> 12 (2013-11-07 15:41:30)
> TIMER_START{org.apache.sling.servlets.get.DefaultGetServlet#0}
> 24 (2013-11-07 15:41:30)
> TIMER_END{12,org.apache.sling.servlets.get.DefaultGetServlet#0}
> 25 (2013-11-07 15:41:30) TIMER_START{handleError:status=404}
> 27 (2013-11-07 15:41:30) TIMER_END{2,handleError:status=404} Using
> handler
> org.apache.sling.servlets.resolver.internal.defaults.DefaultErrorHandlerServlet
> 29 (2013-11-07 15:41:30) TIMER_END{29,Request Processing} Dumping
> SlingRequestProgressTracker Entries
>
> ApacheSling/2.2 (Apache Tomcat/6.0.32, Java HotSpot(TM) 64-Bit Server VM
> 1.6.0_23, Linux 3.5.0-42-generic amd64)
>
>
>
> --
> View this message in context: http://apache-sling.73963.n3.nabble.com/Resource-resolution-tp4028847.html
> Sent from the Sling - Users mailing list archive at Nabble.com.
--
Sent from my (old) computer