Hi Branden, it might help you to have a look at: http://dev.day.com/microsling/content/blogs/main/cheatsheet.html
There you can see how URLs are composed/decomposed. For your case /content/portal/users/admin/pages/home/widgets/hello_world*.html* /widget.html might do the trick ;) HTH Best regards, Dominik On Mon, Aug 24, 2009 at 8:46 PM, Branden Visser <[email protected]> wrote: > Hi all, > > I'm trying to access a resource, then append a suffix to the URI. The > problem is that the GET servlet seems to be taking my full URI, and > returning a 404, even though there is a valid resource found in a substring > of the URL. Here is what I have: > > URI: /content/portal/users/admin/pages/home/widgets/hello_world/widget.html > > The idea is that /widget.html is the suffix (there is no 'widget' > resource!), and therefore Sling will attempt to execute hello_world. > > hello_world has sling:resourceType="portal/widgets/url/url", and the > following file exists: /apps/portal/widgets/url/url/GET.esp. > > However, when I hit the URI above, I get 404. My intention is to make > GET.esp create the resource "widget" below hello_world automatically if it > does not exist. > > From what I understand from the URL decomposition and resource resolution > [1], since /widget does not exist, hello_world should be the mapped > resource, while /widget.html is the suffix. Correct? > > Here is my request breakdown: > > 0 (2009-08-24 14:33:17) Starting Request Processing > 0 (2009-08-24 14:33:17) Method=GET, > PathInfo=/content/portal/users/admin/pages/home/widgets/hello_world/widget.html > 0 (2009-08-24 14:33:17) Starting ResourceResolution > 9 (2009-08-24 14:33:17) > URI=/content/portal/users/admin/pages/home/widgets/hello_world/widget.html > resolves to Resource=NonExistingResource, > path=/content/portal/users/admin/pages/home/widgets/hello_world/widget.html, > elapsed = 9ms > 9 (2009-08-24 14:33:17) Resource Path Info: SlingRequestPathInfo: > path='/content/portal/users/admin/pages/home/widgets/hello_world/widget.html', > selectorString='null', extension='null', suffix='null' > 9 (2009-08-24 14:33:17) Starting ServletResolution > 9 (2009-08-24 14:33:17) Starting resolveServlet(NonExistingResource, > path=/content/portal/users/admin/pages/home/widgets/hello_world/widget.html) > 9 (2009-08-24 14:33:17) Using servlet > org.apache.sling.servlets.get.DefaultGetServlet, elapsed = 0ms > 9 (2009-08-24 14:33:17) > URI=/content/portal/users/admin/pages/home/widgets/hello_world/widget.html > handled by Servlet=org.apache.sling.servlets.get.DefaultGetServlet, elapsed > = 0ms > 9 (2009-08-24 14:33:17) Applying request filters > 9 (2009-08-24 14:33:17) Calling filter: > org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter > 9 (2009-08-24 14:33:17) Starting > org.apache.sling.servlets.get.DefaultGetServlet#0 > 9 (2009-08-24 14:33:17) > org.apache.sling.servlets.get.DefaultGetServlet#0, elapsed = 0ms > 10 (2009-08-24 14:33:17) Starting handleError:status=404 > 10 (2009-08-24 14:33:17) Using handler Sling Default Error Handler > Servlet, elapsed = 0ms > 10 (2009-08-24 14:33:17) Error handler finished, elapsed = 0ms > > It's clear that the GetServlet is using the full URI, and not attempting to > parse a suffix. > > Any ideas? > > Thanks, > > Branden > > [1] http://sling.apache.org/site/sling-api.html >
