users@jersey.java.net

Re: [Jersey] hierarchy of resources ?

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 01 May 2009 08:41:38 -0400

Annotation inheritance is described here:

https://jsr311.dev.java.net/nonav/releases/1.0/spec/
spec3.html#x3-330003.6

A couple of additional comments inline below

On May 1, 2009, at 4:46 AM, Felipe Gaścho wrote:
>
> @Path("/root")
> class A {
> @Path("/method")
> public String aaa() {
> ........
> }

You need a method designator (@GET, @POST etc) on the method otherwise
Jersey will treat the returned string as a resource rather than an
entity.

>
> }
>
>
> @Path("/root/sub")
> class B extends A { <<<<<<< is this possible ?

Yes, see description above. This will result in class B responding to /
root/sub/other and /root/sub/method.

>
> @Path("/other")
> public String bbb() {
> ........
> }
> }
>
>
> --
>
> Please help to test this application:
> http://fgaucho.dyndns.org:8080/cejug-classifieds-richfaces
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>