Hi Thierry,

I had not thought of attachDefault, but I do not think it will be a
satisfying solution for my problem.

My earlier problem description was a bit dense, I have meanwhile created
an issue where a concrete example is given (as well as a
patch-suggestion):
http://restlet.tigris.org/issues/show_bug.cgi?id=644

If it needs more clarification, just let me know.

On Thu, 2008-11-06 at 16:20 +0100, Thierry Boileau wrote:
> Hello Bruno,
> 
> I wonder if the Router#attachDefault can serve your purpose. The
> attached Resource or Restlet is invoked when no route matches.
> 
> Best regards,
> Thierry Boileau
> --
> Restlet ~ Core developer ~ http://www.restlet.org
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
> 
> > Hi,
> > 
> > I have a situation where it would be very useful if a router (a normal
> > Restlet Router or the routing part of JAX-RS) could tell in its response
> > whether there was a matching route.
> > 
> > An example to clarify: I would like all requests to be handled by
> > JAX-RS, and if there's no resource class to handle the request, move on
> > to another router to handle the request. (it's not possible to decide on
> > beforehand to what router to go, nor is the caller aware of what
> > resources are available within each router)
> > 
> > This is currently not possible, since what JAX-RS (or the normal Restlet
> > router) does when there's no matching resource class or matching route
> > is setting the response to 404. This is ok, but it doesn't allow to make
> > the distinction between "no matching route" or "a route matched, but the
> > addressed resource was not found".
> > 
> > Any suggestions?
> > 
> > Would this be something that could be considered for inclusion in
> > Restlet? The solution I'm thinking of is that restlets which perform
> > routing (= Router, JaxRsRestlet, possibly others) could set a special
> > response attribute to indicate there was no matching route.
> > 
> >   

Reply via email to