specif freemarker template path

Paul Barry <[email protected]>
Newsgroups gmane.comp.java.open-symphony.webwork
Message-ID <6152851.1145407561121.JavaMail.os-j2ee@opensymphony01.managed.contegix.com>
Hello,

I am learning webwork, I have exerience with Spring MVC.  I would like to use freemarker as the view technology.  In spring, you configure a FreeMarkerConfigurer and tell it what you want the templatePath to be.  Example:

<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
  <property name="templateLoaderPath">
    <value>/WEB-INF/freemarker/</value>
  </property>
</bean>

This is nice, because this, along with "suffix = .ftl" in the ViewResolver, allows you just refer to /WEB-INF/freemarker/user.ftl as "user" in your Controller class.

I would like to do the same thing in webwork, so I don't have to put /WEB-INF/freemarker/ over and over in the xwork.xml.  I can live with user.ftl, assuming there is no support for suffix.  I tried creating a freemarker.properties, putting it in WEB-INF/classes.  In that file, I put this:

templateLoaderPath=/WEB-INF/freemarker/

But I just get this:

java.io.FileNotFoundException: Template /user.ftl not found.

This page:

http://wiki.opensymphony.com/display/WW/FreeMarker

Says this in the Template Loader section:

"In addition, you can specify a location (directory on your file system) thru templatePath context variable (in your web.xml). If variable is specified, the content of the directory it points to will be searched first."

So I tried adding this to my web.xml:

  <context-param>
    <param-name>templatePath</param-name>
    <param-value>/WEB-INF/freemarker/</param-value>
  </context-param> 

Still the same error.  Any ideas?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=26453&messageID=52061#52061

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.