Hi Vidar,

It is currently not possible to register a servlet/script for "no
extension".

What you could do as a workaround (not complete, though) is to register
the servlet just for the GET method without an extension and send 404
(or so) on requests with an extension.

If you can come up with a good solution to this problem (maybe an API
call such as

   boolean canHandle(SlingHttpServletRequest)

in an interface, which a servlet may implement. If a servlet would be
selected which implements the method and returns false, the servlet
would be ignored for the resolution and the resolution process would
continue as if the servlet would not exist.

(yes, we discussed this already, but never got around to doing it. You
are of course welcome to provide something like that...)

Regards
Felix

Am Dienstag, den 01.04.2008, 17:55 +0200 schrieb Vidar Ramdal:
> Hi;
> 
> I want to register a servlet that should only be invoked on a given
> resourceType, and when the request has no extension.
> 
> Given a JCR node /content, with sling:resourceType=ourResourceType
> 
> The servlet should handle this request: GET /content
> ... but not this: GET /content.html
> 
> >From http://incubator.apache.org/sling/site/servlet-resolution.html
> (albeit outdated) I read that "[...] a Resource provider is registered
> for the Servlet for each permutation resource types, selectors,
> extensions and methods".
> What I want, is not all possible permutations, but rather the
> intersection of extension and resourceType.
> Is this possible?
> 

Reply via email to