svn commit: r997422 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/FreeMarkerViewHandler.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r997422 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/FreeMarkerViewHandler.java

doogie-3
Author: doogie
Date: Wed Sep 15 17:56:52 2010
New Revision: 997422

URL: http://svn.apache.org/viewvc?rev=997422&view=rev
Log:
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,