Search code examples
restrestletrestlet-2.3.1

How to create sub resource in restlet


How to create a sub resource in restlet

1- I want to have two @Get annotated method in same resource 2- I want to assign each method a URI


Solution

  • In fact, this can only be done using the JAX-RS support of Restlet. For the native REST support (classes that extend ServerResource) they can be attached to a single path. I mean every annotated methods in the server resource will be called on the same path.

    That said you can define several @Get methods in a same server resource but the routing will be done based on media types or query parameters.

    Hope it answers your question. Thierry