Hello all,
I'm running JDK 1.6 with Restlet 1.2 and the included FreeMarker all
being served from a Tomcat 6 container. My FreeMarker templates are in
the web content root under the directory freemarker-templates.
I used to cast the context to a ServletContextAdapter before 1.2, and
was able to tell my FreeMarker Configuration to obtain my Templates from
the ServletContext, but that's not true anymore. Is there a way to get
the ServletContext now?
I am able to use this:
getContext().getClientDispatcher().get("war:///freemarker-templates/" +
templateName).getEntity();
and wrap it in a TemplateRepresentation, but my <#include
"myHeader.ftl"> files within my templates no longer work as they're
relative URLs.
So which way is better? Is there a better third option?
Thank you!
Dustin
--
Dustin N. Jenkins | Tel/Tél: 250.363.3101 | [email protected]
facsimile/télécopieur: (250) 363-0045
National Research Council Canada | 5071 West Saanich Rd, Victoria BC.
V9E 2E7
Conseil national de recherches Canada | 5071, ch. West Saanich, Victoria
(C.-B) V9E 2E7
Government of Canada | Gouvernement du Canada
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1617986