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

Reply via email to