users@jersey.java.net

Re: Including Folder path as a URI variable

From: emile <shrrrine_at_gmail.com>
Date: Fri, 12 Mar 2010 04:01:27 -0800 (PST)

Hi Pavel,

I had messed up the regex; so now its working fine i.e. @Path("/{folderid:
[a-zA-Z_0-9]|.*}").

I have two methods(with the same URI), one producing a JSON and the other
producing an XML. By default IE, picks JSON when i dont specify the
extension. But after adding this regex, the method that is placed first in
order is getting invoked. Not sure how to overcome this.

        @GET
        @Produces(MediaType.APPLICATION_XML)
        @Path("/{folderid: [a-zA-Z_0-9]|.*}")
        public String getFolder(@PathParam("folderid") String folderId)
        {
         }

        @GET
        @Produces(MediaType.APPLICATION_JSON)
        @Path("/{folderid: [a-zA-Z_0-9]|.*}")
        public String getFolder(@PathParam("folderid") String folderId)
        {
         }


-- 
View this message in context: http://n2.nabble.com/Including-Folder-path-as-a-URI-variable-tp4716343p4721712.html
Sent from the Jersey mailing list archive at Nabble.com.