On Thu, Feb 25, 2010 at 20:53, Andreas Schaefer <schaef...@me.com> wrote: > Still the servlet is not called using this: > > curl -X POST http://localhost:8080/client/myTest > > but it works with this: > > curl -X POST http://localhost:8080/client.servlet/myTest > > Does this mean that the a servlet path without '.servlet' suffix is only > handled when that particular path is entered? And with the '.servlet' suffix > any path after that is redirected to that servlet? > > Is there any way to tell Sling to redirect a sub path to a particular servlet > without the '.servlet' suffix??
It very much depends on what part of the path exists as resource/node already. Sling will use the longest matching and existing path as resource and resolve servlets from there. See [1]. Then either a servlet with a matching path will be used (sling.servlet.paths) or the resource type (node type or sling:resourceType) will be used to locate a servlet. I would recommend to use the latter variant as much as possible. Using the resource type indirection gives you more flexibility: you can use the same servlet for many resources and changing URLs is done by changing content only, not modifying servlet code. [1] http://sling.apache.org/site/url-decomposition.html Regards, Alex -- Alexander Klimetschek alexander.klimetsc...@day.com