users@jersey.java.net

Re: Matching on param types

From: amsmota <amsmota_at_gmail.com>
Date: Tue, 14 Sep 2010 05:53:08 -0700 (PDT)

*Uau, well spotted... I'll try it rigth away.

Thanks.

*
* Melhores cumprimentos / Beir beannacht / Best regards
**_____________________________________________________________*
*António Manuel dos Santos Mota
Contacts: http://card.ly/amsmota
**_____________________________________________________________
If you're on a mobile phone you can add my contact
by scanning the code on the card below
*
**
<http://lh3.ggpht.com/_1aTCd17_nho/TEblN4fV-_I/AAAAAAAAAHw/wZ51kXrfJcs/qrcode_bc_1.jpg>
Please click on the image to enlarge
it<http://lh3.ggpht.com/_1aTCd17_nho/TEblN4fV-_I/AAAAAAAAAHw/wZ51kXrfJcs/qrcode_bc_1.jpg>
*_____________________________________________________________
* *Disclaimer: The opinions expressed herein are just my opinions and they
are not necessary right.*
*_____________________________________________________________*


On 14 September 2010 13:43, Martin Matula [via Jersey] <
ml-node+5530109-74216269-158495_at_n2.nabble.com<ml-node%2B5530109-74216269-158495_at_n2.nabble.com>
> wrote:

> Hi,
> You can't have exactly the same template on multiple GET methods. It
> will report an error during the application deployment:
>
> However, you do the following:
>
> > @GET
> > @Path("/process/{id: [0-9]+}")
> > void process(@PathParam("id")long id);
> >
> > @GET
> > @Path("/process/{id}")
> > void process(@PathParam("id")String id);
>
> In this case, the more specific template gets picked up - i.e. the
> first one if it matches, otherwise the second one.
> Martin
>
> On Sep 14, 2010, at 5:13 AM, amsmota wrote:
>
> >
> > Hi all, I have another question. Does Jersey (or JAX-RS) consider the
> > parameter types when matching URLs?
> >
> > For instance
> > @GET
> > @Path("/process/{id}")
> > void process(@PathParam("id")long id);
> >
> > @GET
> > @Path("/process/{id}")
> > void process(@PathParam("id")String id);
> >
> > does /process/123 matches the first method and /process/aaa the
> > second one?
> >
> > Cheers.
> > --
> > View this message in context:
> http://jersey.576304.n2.nabble.com/Matching-on-param-types-tp5530004p5530004.html<http://jersey.576304.n2.nabble.com/Matching-on-param-types-tp5530004p5530004.html?by-user=t>
> > Sent from the Jersey mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5530109&i=0>
> > For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5530109&i=1>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5530109&i=2>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5530109&i=3>
>
>
>
> ------------------------------
> View message @
> http://jersey.576304.n2.nabble.com/Matching-on-param-types-tp5530004p5530109.html
> To unsubscribe from Matching on param types, click here<http://jersey.576304.n2.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=5530004&code=YW1zbW90YUBnbWFpbC5jb218NTUzMDAwNHwtMTUwMDU4NTM4Nw==>.
>
>
>

-- 
View this message in context: http://jersey.576304.n2.nabble.com/Matching-on-param-types-tp5530004p5530150.html
Sent from the Jersey mailing list archive at Nabble.com.