Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Extending the FreemarkerManager

ARakesh

2007-11-02

Replies:


I am extending to FreemarkerManager to customize the tempalte:

  @Override
  protected Configuration createConfiguration(ServletContext
servletContext) throws TemplateException {
    Configuration config = super.createConfiguration(servletContext);
    ClassTemplateLoader ctl = new ClassTemplateLoader(getClass(), "");
    TemplateLoader[] loaders = new TemplateLoader[] { ctl };
    MultiTemplateLoader mtl = new MultiTemplateLoader(loaders);
    config.setTemplateLoader(mtl);
    System.out.println("PlutoFreeMarkerManager.createConfiguration()");
    return config;
  }

So, i override this protected method right. And then in the struts.xml I set
the following property

  <constant name="struts.freemarker.manager.classname"
value="com.plateau.demo.pluto.servlet.PlutoFreeMarkerManager"></constant>

But, when I try to access the my application it says it could not find the
FTL files.

Keeping that aside, I tried keeping some basic log messages by overriding
the method but no use, the basic issue I am having is how else can I make
struts to use my Custom Freemarker class.

Any ideas, please?

Rakesh
--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.