Hi Li / Maurizio,
 
thanks for your replies - i did receive the answer from another user yesterday 
too, he sent the following
 
Actually, I found the solution, and it works for me:
 
http://old.nabble.com/-S2--2.2.1-possible-freemarker-template-bug-td29462347.html
 
Just add this to your web.xml:
 
    <context-param> 
        <param-name>templatePath</param-name> 
        <param-value>template</param-value> 
    </context-param>
 
it seems it has been noted by others (see link) and is a bug of sorts - could 
be it was supposed to be this way and struts2.0.11 didn't enforce it or it was 
just changed in later version and developer didn't realise full implications.
 
anyway, the addition of the context-param sorted out my problem.
 
thanks for your responses
 
adam

 
> Date: Wed, 20 Oct 2010 12:01:34 +0900
> Subject: Re: Overriding Templates
> From: liying.cn.2...@gmail.com
> To: user@struts.apache.org
> 
> Hi Maurizio:
> 
> In this document:
> http://struts.apache.org/2.2.1/docs/template-loading.html
> 
> It says the template should be searched in (in this order):
> 1, web app folder
> 2, class path
> 
> But i have read the Struts2.2.1 source code, it creates TemplateLoader
> in a different order, as i described in my earlier mail.
> 
> And, as adam said, the template under web app folder worked correctly
> in elder version of Struts2.
> 
> So i think, this is maybe a BUG of Struts2,
> or lack of updating document.
> Maybe we should send this issue to the development team of Struts2.
> 
> 
> 
> 2010/10/20 Maurizio Cucchiara <maurizio.cucchi...@gmail.com>:
> > @Adam
> >
> >> and they were placed into WebContent\template\simple folder
> >
> > you should start to investigate about your path correctness IMHO .
> > Struts usually finds freemarker template inside your classpath. In
> > order to enable struts to find your custom template file, you should
> > ensure that template files reside inside the
> > WEB-INF/classes/template/simple folder
> >
> > Hope this help
> >
> > --
> > Maurizio Cucchiara
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
                                          

Reply via email to