Hello Julien,

if you want to access files that are located inside your "WebContent" directory, you can use the integrated war client just as follow: Representation rep = getContext().getDispatcher().get("war:///files/file.xml").getEntity();
and then use the representation as you want.
NB: you can reuse parameters used for routing. For example, if your restlet has been reached according to the template "/segment/{myParameter}": Representation rep = getContext().getDispatcher().get("war:///files/file{myParameter}.xml").getEntity();

What is the relationship between a restlet and a servlet ? none ?

The relation between a servlet and a restlet is made with the ServerServlet extension [1], and more precisely with the ServerServlet class which transmits servlet calls to your restlets, and the ServletContextAdapter that instantiates the war client and transmits all servlet context parameters to the restlet context parameters.

Is there a way to get to javax.servlet.ServletContext from an org.restlet.Application ?

Here is the way to get the servletContext:
ServletContextAdapter adapter = (ServletContextAdapter) getContext();
ServletContext servletContext = adapter.getServletContext();

Please feel free to ask for more details.

Best regards,
Thierry Boileau
[1] http://www.restlet.org/documentation/1.0/ext/com/noelios/restlet/ext/servlet/package-summary.html

Reply via email to