This might be a typo or the source of your problem, but you have this: > /imgs/a/b/c/640x480/r/img.jpg
but are requesting > /imgs/a/b/c/640x480/of/img.jpg look at the second-to-last path segment. Is "r" in the first example (and your regex) and "of" in the second example. Justin On Thu, Oct 14, 2010 at 5:43 PM, sam lee <[email protected]> wrote: > Hey, > > I want http request: > GET /imgs/a/b/c/640x480/r/img.jpg > > to be resolved to the JCR node: > /content/images/a/b/c/img.jpg/jcr:content/thumbnails/640x480 > > I looked at: > http://sling.apache.org/site/mappings-for-resource-resolution.html > > And, my current /etc/map is: > /etc/map/any (sling:Mapping) > - sling:match = http://[^/]+/imgs/(.+)/([^/]+)/r/([^/]+)$ > - sling:internalRedirect = /content/images/$1/$3/jcr:content/thumbnails/$2 > > But, GET /imgs/a/b/c/640x480/of/img.jpg gives me 404. > Is there something I'm doing wrong? > > Am I approaching the problem properly? > Using regex seems brittle. > > If I were to write a class that knows how to convert short path to actual > jcr path, what interface should the class implement? And, how can I register > it to sling's DefaultGetServlet? > > Thanks. > Sam >
