Author: jleroux
Date: Thu Jan 20 14:23:29 2011
New Revision: 1061310
URL:
http://svn.apache.org/viewvc?rev=1061310&view=revLog:
A patch from Chatree Srichart "Fix using TagLib in Freemarker." (
https://issues.apache.org/jira/browse/OFBIZ-2703) - OFBIZ-2703
Fix using TagLib in freemarker follow this.
1. In ControlServlet.java, create ServletContextHashModel instance and set to request's attritube
2. In ScreenRenderer.java, set ServletContextHashModel instance from request's attribute to context name Application and set HttpRequestHashModel instance from requestAttributes in context to context name Request
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java
Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java?rev=1061310&r1=1061309&r2=1061310&view=diff==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlServlet.java Thu Jan 20 14:23:29 2011
@@ -202,7 +202,7 @@ public class ControlServlet extends Http
request.setAttribute("security", security);
request.setAttribute("_REQUEST_HANDLER_", requestHandler);
-
+
ServletContextHashModel ftlServletContext = new ServletContextHashModel(this, BeansWrapper.getDefaultInstance());
request.setAttribute("ftlServletContext", ftlServletContext);
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java?rev=1061310&r1=1061309&r2=1061310&view=diff==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ScreenRenderer.java Thu Jan 20 14:23:29 2011
@@ -243,7 +243,7 @@ public class ScreenRenderer {
TaglibFactory JspTaglibs = new TaglibFactory(servletContext);
context.put("JspTaglibs", JspTaglibs);
context.put("requestParameters", UtilHttp.getParameterMap(request));
-
+
ServletContextHashModel ftlServletContext = (ServletContextHashModel) request.getAttribute("ftlServletContext");
context.put("Application", ftlServletContext);
context.put("Request", context.get("requestAttributes"));