Hi Sam,

by default a variable is supposed to "eat" at least one character. In your case, the route "/lastRiskEval/{personid}" cannot match the URI "/lastRiskEval/". Another question is what is the resource behind "/lastRiskEval/"? Does this URI really correspond to a "LastRiskEvaluationResource" instance?

best regards,
Thierry Boileau

I can try this, but I'm curious as to am I declaring the variable wrong? Is the example below the proper way to do that? Thanks.
Sam Bao | Software Engineer | Cerner Corporation | 816.201.8242 | [EMAIL 
PROTECTED] | www.cerner.com

-----Original Message-----
From: Thierry Boileau [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 13, 2008 10:03 AM
To: [email protected]
Subject: Re: URI won't match what's attached to the router

Hello Sam,

you can update the "personid" variable in order to make it facultative:

Route route = router.attach("/lastRiskEval/{personid}",
LastRiskEvaluationResource.class);
// You can use other Variable.TYPE_...
Variable variable = new Variable(Variable.TYPE_ALPHA_DIGIT, "", false, false); 
route.getTemplate().getVariables().put("personid", variable);


best regards,
Thierry Boileau

I've got the following resource attached to my router:

        Router router = new Router(getContext());
        router.attach("/conditions", ConditionsResource.class);
        router.attach("/facts", FactsResource.class);
        router.attach("/risks", RisksResource.class);
        router.attach("/riskEval", RiskEvaluationResource.class);
router.attach("/lastRiskEval/{personid}", LastRiskEvaluationResource.class);

However, when I try to go to the LastRiskEvaluationResource without giving it a 
person id, I get a 404.

I'm just running the http server locally, and so the url I'm using is: http://localhost:8182/lastRiskEval/

However, I get a 404.  I traced it down to where the Decoder.handle() tries to 
getNext() and doesn't find the 'next' because when getting routes, it uses the 
BEST method, but never matches my URI.  I'm using 1.0.9, does anyone have a 
clue on what I should try?

I've had this work before on another Application where I had 
"/results/{personid}" and it'd work.

----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from 
Cerner Corporation and are intended only for the addressee. The information 
contained in this message is confidential and may constitute inside or 
non-public information under international, federal, or state securities laws. 
Unauthorized forwarding, printing, copying, distribution, or use of such 
information is strictly prohibited and may be unlawful. If you are not the 
addressee, please promptly delete this message and notify the sender of the 
delivery error by e-mail or you may call Cerner's corporate offices in Kansas 
City, Missouri, U.S.A at (+1) (816)221-1024.




Reply via email to