Re: Loading FTL templates from JAR in maven
Daniel Dekany <[email protected]> Wed, 25 Dec 2013 11:34:52 +0100
| Newsgroups | gmane.comp.web.freemarker.devel |
|---|---|
| Message-ID | <[email protected]> |
The defining class loader of the class that you are using as the first
parameter of setClassForTemplateLoading must be able to access the
resources. That is, ClassLoader.getResource(templateResourcePath) must
work with it. Does it? If it does, then maybe the second parameter to
setClassForTemplateLoading is incorrect ("/" is a strange choice), or
the template names you are using aren't fit to it.
--
Thanks,
Daniel Dekany
Tuesday, December 24, 2013, 11:44:43 PM, Vijay wrote:
> Hi,
>
> I am a newbie to FTL and requires your help.
>
> We are building a site which has various modules with war's and jar's and
> trying to use FTL for front end rendering.
>
> The FTL templates are available as JAR(with different folders inside) in
> repository and I have to include it as dependency in one of my pom.xml
>
> The ControllerServlet(which extends FreemarkerServlet) is available in one
> of my JAR module and JSP's are in WAR file
>
> 1) Do I need to include the template dependency in JAR or in WAR
> 2) I have included the dependency in my JAR module and tried to read the
> templates by mentioning
> config.setClassForTemplateLoading(getClass(), "/") in my controller. But I
> am not able to read the templates.
> Can you please guide me on configuration to load the template in
> ControllerServlet.
>
> If I need to include the dependency in WAR, how do I use FTL to render.
> Please guide me.
>
>
>
>
> --
> View this message in context:
> http://freemarker.624813.n4.nabble.com/Loading-FTL-templates-from-JAR-in-maven-tp4654896.html
> Sent from the freemarker-devel mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> FreeMarker-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk