I am also not sure what exactly you are trying to do, but find some answers inline.
On Fri, Feb 26, 2010 at 01:35, Andreas Schaefer <[email protected]> wrote: > Well, I might be abusing Sling but what I want to do is to have sort of an > Entry Point / Guard Servlet before I actually call Sling or use sling to > store data into JCR. There are two things in Sling which should be separated here: first is the engine, which is basically one servlet handling the whole webapp context (eg. /*), which will do (in this order) URL decomposition, resource resolution and servlet/script resolution. On the other hand there are the Sling default GET and POST servlets, designed for accssing the JCR (and other stuff behind the resource abstraction). These are "just" a few special servlets that are handled like any other in the sling engine. WRT "entry point / guard servlet": you can register servlet filters in Sling [1] and for the standard POST servlet you can write custom operations [2] and you can use so-called post processors to validated/check things in the transient session before it gets saved (but after the POST request was applied on the session) [3]. [1] http://sling.apache.org/site/filters.html [2] http://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html [3] http://sling.apache.org/apidocs/sling5/org/apache/sling/servlets/post/SlingPostProcessor.html > The backend application only handles operation called by the client (Ext/JS > for now) with JSon (in and out). There is no presentation provided by the > Sling component. > On the other hand the Client is driving the API and so the backend has adhere > to it and translate it to Sling API calls. > > Therefore I want to close Sling using Authentication except when calling a > particular URL. The URL might contain a reference to a resource but the > effective resource might be located somewhere else and the Servlet would > translate that path back and forth. > > Well, at least now I know why my Servlet gets called using "client.servlet" > because the rest of the URL becomes the suffix. But I am still not quite sure > why the servlet path adds '.sevlet' and is only accessible through that. I believe this a requirement when directly calling servlets. But as I said, you should rather look into registering your servlets based on the resource type they work on, because this is much more in the idea of Sling (and more RESTful, if this can be said). Regards, Alex -- Alexander Klimetschek [email protected]
