You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by wolverine my <wo...@gmail.com> on 2006/11/14 02:24:21 UTC

[s2] Loading FreeMarker template from Classpath?

Hi!

In http://cwiki.apache.org/WW/freemarker.html, it explained that
Struts 2 looks for FreeMarker template in Web application followed by
the Class path.

However, when I placed my FreeMarker template in
webapps/dummy/WEB-INF/classes/com/dummy/test.ftl


it caused the following exception:

java.io.FileNotFoundException: Template /test.ftl not found.
	freemarker.template.Configuration.getTemplate(Configuration.java:441)
	freemarker.template.Configuration.getTemplate(Configuration.java:411)


Isn't it test.ftl included in the Class path? Did I miss out anything here?

Note: it works when I placed the test.ftl in webapps/dummy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Loading FreeMarker template from Classpath?

Posted by wolverine my <wo...@gmail.com>.
Hi Chris

Yes, it works when I put the file in WEB-INF/classes

On 11/14/06, Chris Pratt <th...@gmail.com> wrote:
> Remember the thing that is on the classpath is WEB-INF\classes, not it's
> subclasses.  I don't use FreeMarker, but I'd suggest puting that file in
> WEB-INF\classes and giving it a try.
>  (*Chris*)
>
> On 11/13/06, wolverine my <wo...@gmail.com> wrote:
> >
> > Hi!
> >
> > In http://cwiki.apache.org/WW/freemarker.html, it explained that
> > Struts 2 looks for FreeMarker template in Web application followed by
> > the Class path.
> >
> > However, when I placed my FreeMarker template in
> > webapps/dummy/WEB-INF/classes/com/dummy/test.ftl
> >
> >
> > it caused the following exception:
> >
> > java.io.FileNotFoundException: Template /test.ftl not found.
> >         freemarker.template.Configuration.getTemplate(Configuration.java
> > :441)
> >         freemarker.template.Configuration.getTemplate(Configuration.java
> > :411)
> >
> >
> > Isn't it test.ftl included in the Class path? Did I miss out anything
> > here?
> >
> > Note: it works when I placed the test.ftl in webapps/dummy
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Loading FreeMarker template from Classpath?

Posted by Chris Pratt <th...@gmail.com>.
Remember the thing that is on the classpath is WEB-INF\classes, not it's
subclasses.  I don't use FreeMarker, but I'd suggest puting that file in
WEB-INF\classes and giving it a try.
  (*Chris*)

On 11/13/06, wolverine my <wo...@gmail.com> wrote:
>
> Hi!
>
> In http://cwiki.apache.org/WW/freemarker.html, it explained that
> Struts 2 looks for FreeMarker template in Web application followed by
> the Class path.
>
> However, when I placed my FreeMarker template in
> webapps/dummy/WEB-INF/classes/com/dummy/test.ftl
>
>
> it caused the following exception:
>
> java.io.FileNotFoundException: Template /test.ftl not found.
>         freemarker.template.Configuration.getTemplate(Configuration.java
> :441)
>         freemarker.template.Configuration.getTemplate(Configuration.java
> :411)
>
>
> Isn't it test.ftl included in the Class path? Did I miss out anything
> here?
>
> Note: it works when I placed the test.ftl in webapps/dummy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>