I am building a Restlet project in MyEclipse. I had the app working as a Java
app and decided it would be better to convert it to run as a servlet on a
Tomcat server. I have been using the example code in "Restlet in Action". I
am having a problem rearranging the files so that FreeMarker can find my
templates.
This get() method is in:
C:\My
Documents\Workspaces\MyEclipse\PeopleAndProductions\src\control\PandP_ServerResource.java
This is the code that can not find the template:
protected Representation get() throws ResourceException {
// Create the root hash
String rootURL = PandP_0_Constants.ROOT_URI + ":" +
PandP_0_Constants.DEFAULT_PORT + PandP_0_Constants.APPLICATION_URI;
Map<String, Object> rootHash = new HashMap<String,
Object>();
rootHash.put("title", "ACTORS' People and Productions");
rootHash.put("rootURL", PandP_0_Constants.ROOT_URI + ":" +
PandP_0_Constants.DEFAULT_PORT + PandP_0_Constants.APPLICATION_URI);
Representation venuesFtl = null;
Representation result = null;
try {
venuesFtl = new
ClientResource(LocalReference.createClapReference("templates/PeopleAndProductions.html")).get();
result = new TemplateRepresentation(venuesFtl, rootHash,
MediaType.TEXT_HTML);
} catch (Exception e) {
logger.debug("PandP_3_ServerResource.get() Exception: "
+ e);
}
return result;
}
The templates are here:
C:\My Documents\Workspaces\MyEclipse\PeopleAndProductions\WebRoot\templates
Can anyone tell me what I need to do to get this to work?
Thanks.
--
View this message in context:
http://restlet-discuss.1400322.n2.nabble.com/Restlet-and-FreeMarker-tp6396656p6396656.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2746122