Author: doogie
Date: Wed Sep 15 17:56:52 2010
New Revision: 997422
URL:
http://svn.apache.org/viewvc?rev=997422&view=revLog:
Use setServletContextForTemplateLoading instead of
setDirectoryForTemplateLoading, so that raw File access is no longer
used. This is to support webslinger, which uses an overlay filesystem
to merge multiple modules, and doesn't really have a single File view of
the webapp.
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/FreeMarkerViewHandler.java
Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/FreeMarkerViewHandler.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/FreeMarkerViewHandler.java?rev=997422&r1=997421&r2=997422&view=diff==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/FreeMarkerViewHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/FreeMarkerViewHandler.java Wed Sep 15 17:56:52 2010
@@ -53,11 +53,7 @@ public class FreeMarkerViewHandler exten
public void init(ServletContext context) throws ViewHandlerException {
this.servletContext = context;
config.setCacheStorage(new OfbizCacheStorage("unknown"));
- try {
- config.setDirectoryForTemplateLoading(new File(servletContext.getRealPath("/")));
- } catch (IOException e) {
- throw new ViewHandlerException("Could not create file for webapp root path", e);
- }
+ config.setServletContextForTemplateLoading(context, "/");
}
public void render(String name, String page, String info, String contentType, String encoding,