9.10. Obtaining FreeMarker

Problem

You need to use FreeMarker to write templates that can reference variables, object properties, and DOM Node objects.

Solution

You must download the latest version of FreeMarker, and place the FreeMarker JAR in your project’s classpath. Go to the FreeMarker download page at http://www.freemarker.org/freemarkerdownload.html, and download the FreeMarker 2.3 distribution. After you untar and unzip the distribution, you will find a freemarker.jar file in the lib directory; place this file in your project’s classpath.

Discussion

If you have a Maven project that needs to use FreeMarker, add a dependency on FreeMarker with the following section in project.xml:

<dependencies>
  <dependency>
    <id>freemarker</id>
    <version>2.3</version>
  </dependency>

  ....other dependencies...
</dependencies>

See Also

To learn more about FreeMarker, visit the FreeMarker web site (http://www.freemarker.org/).

To participate in the FreeMarker community, join the FreeMarker users or developers list (http://sourceforge.net/mail/?group_id=794).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.13.192