On Fri, Mar 28, 2008 at 9:07 PM, Bertrand Delacretaz
<[EMAIL PROTECTED]> wrote:
> On Fri, Mar 28, 2008 at 4:52 PM, Vidar Ramdal <[EMAIL PROTECTED]> wrote:
>  > ... So, is there a way to use a servlet filter with Sling?...
>
>  Yes, see the ZipFilter example:
>
>  
> http://svn.apache.org/repos/asf/incubator/sling/trunk/sling/sample/src/main/java/org/apache/sling/sample/filter/ZipFilter.java

Thanks, I got the filter running. However, in order for it to be
useful, I need to invoke it in a regular servlet container fashion -
that is, BEFORE any servlets get to handle the request.
The Sling (and I assume OSGi?) way is to let a servlet take care of
invoking filters. In Sling's case, that seems to be SlingMainServlet.

Now, this is not what I want, because
SlingMainServlet#service(HttpServletRequest, HttpServletResponse)
resolves the resource before invoking filters. My filter is designed
to manipulate the request so that Sling will resolve to a different
resource (based on the HTTP host header, as outlined in
https://issues.apache.org/jira/browse/SLING-249).

So I would like to let the filter process the request before
SlingMainServlet gets to it. How can I accomplish that (if possible)?


-- 
Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no
Akersgata 16, N-0158 Oslo, Norway

Reply via email to