I am not decorating JSP with freemarker decorators, I am decorating JSP with JSP, but I use the following filter -
<filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class> </filter> The filter you are using might be buggy... I don't know if it has seen any attention in a while. If you get a moment, whip up a simple example web-app that demonstrates the problem and create a JIRA on it. A quick look in JIRA shows that someone was working on a solution for sitemesh issues - http://issues.apache.org/jira/browse/WW-3296 But, I haven't seen a patch yet. Anyhow, I don't know sitemesh well enough to say whether using SiteMeshFilter will fix your problem, but give it a try. If you provide a sample app, I'll try to get it fixed for the next release. -Wes On Mon, Mar 15, 2010 at 1:19 PM, jonathan doklovic <list-rea...@sysbliss.com> wrote: > All of the code is listed in the stackoverflow question. > > I'm using: > > Struts 2.1.8.1 > Struts-Sitemesh Plugin 2.1.8.1 > Sitemesh 2.4.2 > Freemarker 2.3.15 > > Currently, I just have a single index.action that returns index.jsp which is > decorated with a single main.ftl file. > > The jsp just has the simplest html structur with a string in the body. > The ftl decorator just adds a string and tries to spit out the body of the > jsp. > > my struts.xml is: > > <struts> > <constant name="struts.devMode" value="true"/> > <package name="basicstruts2" extends="struts-default"> > <action name="index"> > <result>/index.jsp</result> > </action> > </package> > </struts> > > my web.xml filters are: > > <filter> > <filter-name>struts-prepare</filter-name> > > <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class> > </filter> > > <filter> > <filter-name>sitemesh</filter-name> > > <filter-class>org.apache.struts2.sitemesh.FreeMarkerPageFilter</filter-class> > </filter> > > <filter> > <filter-name>struts2</filter-name> > > <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class> > </filter> > > <filter-mapping> > <filter-name>struts-prepare</filter-name> > <url-pattern>/*</url-pattern> > </filter-mapping> > > <filter-mapping> > <filter-name>sitemesh</filter-name> > <url-pattern>/*</url-pattern> > <dispatcher>REQUEST</dispatcher> > <dispatcher>FORWARD</dispatcher> > <dispatcher>INCLUDE</dispatcher> > </filter-mapping> > > <filter-mapping> > <filter-name>struts2</filter-name> > <url-pattern>/*</url-pattern> > </filter-mapping> > > > > > Wes Wannemacher wrote: >> >> We'll probably need a little more info. In particular, I'd like to >> know is which versions of struts, sitemesh and freemarker you are >> using. Also, how do you have the various filters configured in your >> struts.xml. Also, are you decorating freemarker results with >> freemarker decorators? >> >> -Wes >> >> On Mon, Mar 15, 2010 at 12:05 PM, jonathan doklovic >> <list-rea...@sysbliss.com> wrote: >> >>> >>> I've been working for a week now trying to get Struts2 + Sitemesh + >>> Freemarker to work. >>> I've followed many tutorials and read docs but I still can't get it to >>> work. >>> >>> Basically the decorator runs, but none of the variables get put into >>> scope >>> and so I get literal ${body}, ${title} and ${head} printed out. >>> >>> You can find full details with my source in my stack overflow question: >>> >>> http://stackoverflow.com/questions/2420752/struts2-sitemesh-freemarker-doesnt-work >>> >>> Can anyone help??? >>> >>> Thanks, >>> >>> - Jonathan >>> >>> --------------------------------------------------------------------- >>> 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 > > -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org