Many times, it is convenient to call an OFBiz Java utility or tool directly from within FreeMarker. The OFBiz FreeMarker implementation allows for calling Java methods (utilities and tools) directly from within FreeMarker directives.
Java methods may be called from FreeMarker in the following way:
assign
directive and be sure to use the full Java packaging notation for the method as shown here:<#assign value = Static["org.ofbiz.base.util.UtilProperties"]. getPropertyValue("general.properties", defaultUrl)>
The FreeMarker program is a Java Application (not to be confused with an OFBiz web application) that takes FreeMarker directives, HTML markup, and prepared data and creates HTML destined for a browser. FreeMarker runs within the same JVM as OFBiz and therefore has access to all the runtime tools and utilities on the CLASSPATH.
3.147.85.181