I am trying to create a web application with restlet. how can i call a
file in the web application (using relative path).
I went through documentation of restlet, there creating html content in the
Resource class was explained as shown here.

getResponse().setStatus(Status.SUCCESS_CREATED);
String result="<h3>Item Created. </h3>";
result += " <p>use <br>http://localhost:8080/itemRestlet/itemapp/items<br>in
a new browser instance to see the data.</p>";
Representation rep = new StringRepresentation(result,MediaType.TEXT_HTML);

        The FileRepresentation class can take path of the file you want to
invoke and content type, but here the problem is trying to locate result.jsp
in the webserver installation directory rather than in webapp.

 FileRepresentation rep=new
FileRepresentation("items/result.jsp",MediaType.TEXT_HTML);

        Can any one please help me to invoke this result.jsp from a
resource?
I am trying to invoke a html/jsp page from web application from a
resource....help me please
-- 
View this message in context: 
http://n2.nabble.com/refering-a-web-app-file-with-FileRepresentation-tp1493159p1493159.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

Reply via email to