On Tue, Aug 23, 2011 at 2:56 PM, Carsten Ziegeler <[email protected]> wrote:
> The servlet resolution is based on the resource resolution - and this
> means a path points at exactly one resource. This is nothing we should
> change!
I'm still not getting it. SlingServletResolver#getServlet iterates
through the different matching servlets. What are this different
candidates? Why is it OK to fall back to another kind of resource but
not to a lower priority OptingServlet?

> Again, OptingServlet should be the exception to be used as it makes
> the servlet resolution much more complicated. You have to run the
> request to see which servlet is really used. Therefore this should be
> avoided whereever possible.We found out, that in most cases there are
> better option.
A better option for jax-rs resources would be to register a servlet
for every root-resource, for this the path matching in sling would
have to be as powerful as the one offered by jax-rs (i.e. support
regex).

> For the case at hand, you could register a single servlet at that path
> - which is not an opting servlet and this one dispatches to the other
> servlets, one after the other, until one is processing this request.

Not sure if I understand you correctly, are you suggesting to just
have a separate uri-space for jax-rs resources? (Clearly I would like
a tighter integration for sling to support scripts, Java Sevlets and
JAX-RS root resources at any path.)

Regards,
Reto

Reply via email to