Hello Rohit,

I've tried and succeeded in attaching the same instance and getting the right values from the uris. It seems to work. I notice that you seem to not use the last release of the project (which is about to reach the 1.0 version number). I encourage you to get the last release (http://www.restlet.org/downloads/current.zip) and have a look at the tutorial (http://www.restlet.org/tutorial). However, if it does not mind you I can have a look at your code (or only an excerpt).

Best regards,
Thierry Boileau

Rohit a écrit :
Hi,

I am using the below code snippet,

router.attach("/trade/{tradeId}/{ValueDate}", explainHandler);
router.attach("/portfolio/{portfolioCode}/{ValueDate}", explainHandler);
i.e. same handler is attached to 2 diff URI patterns.

Now when I type the URI in the browser matching the 1st one, it does go to
correct handler and gets me back the result. However, when I type a URL matching
the 2nd in the browser, it fails because
request.getAttributes().get("portfolioCode") returns NULL.

On the other hand, if after restarting the RestServer, I type the URL mathcing
the 2nd first, it returns back the correct result, and then when I type a URL
matching the 1st one, it fails because request.getAttributes().get("tradeId")
returns  NULL.

Am I missing something in the configuration or can we not bind the same handler
for multiple URLs. OR do I need to bind different instances of same handler.
Right now I am binding the same instance with both.

Regards,

Rohit

Reply via email to