On 19.12.11 23:20, "sam ²" <[email protected]> wrote: >And, I want to register a servlet in osgi bundle that will handle all >requests to /imgs/* > >For example, > >GET /imgs/some/image.jpg >GET /imgs/foo/bar.tags.xml >GET /imgs.json >GET /imgs.xml >GET /imgs/foo/bar.html > >and POST.. > >I tried: >@Property(name = "sling.servlet.prefix", value = "/imgs") >@Property(name = "sling.servlet.selectors", value={"tags"}) > >But that alone does not properly register the servlet.
Use sling.servlet.paths = "/imgs". See http://sling.apache.org/site/servlets.html But I would always avoid that if possible, since its not transparent and you don't benefit from JCR ACLs (your servlet has to check access control itself). >I cannot create resources under /imgs. If I could, I could create them and >set sling:resourceType. Why not? If you can install code, why can't you add something to the content structure? Also, you could put it under /content/imgs or /libs/imgs and if you really need the URLs to be /imgs for whatever reason, you can use rewrite rules on the web layer in the apache. Cheers, Alex -- Alexander Klimetschek Developer // Adobe (Day) // Berlin - Basel
