Thank you.

Yes, two routes to the same resource bugs me. It looked a bit strange when I when I coded it.

On Oct 15, 2008, at 1:30 AM, Thierry Boileau wrote:

Hello Mark,

you can have a look at the Request#getResourceRef() (that returns an instance of the Reference class) and the Reference#getLastSegment() methods. Otherwise, you can wonder why there are 2 distinct routes that point to the same resource. Otherwise, you can define the routes as follow and examine the "verb" property in your resource:
router.attach("/sign/{verb}", SignResource.class);
router.attach("/sign/{verb}/{sign}", SignResource.class);

Best regards,
Thierry Boileau
--
Restlet ~ Core developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com

Good day.

If I have

router.attach("/sign/bind", SignResource.class);
router.attach("/sign/lookup/{sign}", SignResource.class);

what is a stylish idiom to get at the "bind" and "lookup" tokens in the URLs above from within the SignResource restlet? Doing so amounts to enabling some finer grain routing within the restlet SignResource, which may or may not belie a potentially naive attempt to do too much in a single restlet handler.

Thanks.

Mark

Reply via email to