Hello,

the parameters of the annotations represent media types (see
http://wiki.restlet.org/developers/172-restlet/226-restlet.html, paragraph
"annotations parameters").
Your interface should look like:
public interface HelloWorld {
       @Get("xml")
       public String hello();
       @Get("json")
       public String test2();
       @Get(text")
       public String test2();
}

As the "hello" and "test2" are not recognised media types, the first
annotated method is chosen, and let the client check that the sent entity is
correct.
If you aim at using "new media types", you can complete the application's
metadata service.
Feel free to ask for more details.

Best regards,
Thierry Boileau


hi,
>
> i've an interface with two functions annotated with @get
>
> public interface HelloWorld {
>        @Get("hello")
>        public String hello();
>        @Get("test2")
>        public String test2();
> }
>
> when i execute the client always the first function is executed but never
> test2 function.
> if i change @get annotation on test2 for @put or any other one everything
> works nice.
>
> any tip to reuse the same annotation ??
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2626099
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2626223

Reply via email to