Hello,
I set up a small standalone server as JaxRsApplication like in the "JAX-RS
extension" example on the website.
My resources are annotated with Jax-Rs Annotations. Every Resource should have
the same entry point. So I was thinking to put @Path("") on each resource class
and the specified resource path to the dedicated methods. When I add these
resources to the application class I get a warning that more than one resource
uses the same root path. The main problem is that I want to add a type
extention to the URI. My URIs should look like this:
www.sample.com/blogs.json
www.sample.com/blogs/3.json
www.sample.com/notes.json
www.sample.com/notes/3.json
So my class definition looks like
@Path("")
public class Blog{
@GET
@Path("/blogs.{extension: [bj]son}")
public String getBlogs(...){
...
}
@GET
@Path("/blogs/{blogId}.{extension: [bj]son}")
public String getBlog(...){
...
}
}
@Path("")
public class Note{
@GET
@Path("/notes.{extension: [bj]son}")
public String getNotes(...){
...
}
@GET
@Path("/notes/{noteId}.{extension: [bj]son}")
public String getNote(...){
...
}
}
Is there a way to get around this?
Thanks a lot in advance.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2650997