struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeromy Evans <jeromy.ev...@blueskyminds.com.au>
Subject Re: Putting Template inside .jar
Date Mon, 03 Mar 2008 01:34:44 GMT
The Struts FreemarkerResult and Struts 2 tags explicitly access a 
Freemarker template engine that's setup via the Struts container.

Your example below references the FreemarkerServlet provided by 
Freemarker that's an distinct instance of the template engine. 
You don't require the FreemarkerServlet to serve Freemarker pages via 
Struts.  You can use it to serve Freemarker pages directly (without struts).

You can use both at the same time, just note that they're separate.  
There's no glue AFAIK.

(Although as you're using spring you may be get them to both use the 
same bean, but I'm not sure about that).

Frans Thamura wrote:
> hi jeromy,
>
> i have several velocity template inside and i want to put in the jar also
>
> i got this is the syntax to implement TemplatePath (below)
>
> i dont get the relationship between freemarker and struts
>
> because in my strutx.xml's package i just change the result to freemarker,
> and .... done, the template engine is freemarker.
>
> can give the glue
>
>
> this is the freemarker template
>
>
>
>
> <servlet>
>   <servlet-name>freemarker</servlet-name>
>   <servlet-class>*freemarker.ext.servlet.FreemarkerServlet*</servlet-class>
>
>   <!-- FreemarkerServlet settings: -->
>   <init-param>
>     <param-name>TemplatePath</param-name>
>     <param-value>/</param-value>
>   </init-param>
>   <init-param>
>     <param-name>NoCache</param-name>
>     <param-value>true</param-value>
>   </init-param>
>   <init-param>
>     <param-name>ContentType</param-name>
>     <param-value>text/html</param-value>
>   </init-param>
>
>   <!-- FreeMarker settings: -->
>   <init-param>
>     <param-name>template_update_delay</param-name>
>     <param-value>0</param-value> <!-- 0 is for development only! Use
> higher value otherwise. -->
>   </init-param>
>   <init-param>
>     <param-name>default_encoding</param-name>
>     <param-value>ISO-8859-1</param-value>
>   </init-param>
>   <init-param>
>     <param-name>number_format</param-name>
>     <param-value>0.##########</param-value>
>   </init-param>
>
>   <load-on-startup>1</load-on-startup>
>
> </servlet>
>
>   
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.516 / Virus Database: 269.21.3/1307 - Release Date: 2/03/2008 3:59 PM
>   


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


Mime
View raw message