struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From orshoe <ors...@yahoo.com>
Subject Re: Need help: <decorator:body /> not parsed
Date Wed, 18 Jul 2007 20:56:08 GMT

I am having the exact same problem, except I am also using Freemarker along
with Sitemesh and Struts 2. I tried using the <decorator:head/> style tags
as well as the OGNL style <@decorator.head/> tags. Viewing the source of the
rendered page on the browser doesn't show the tags themselves (for the OGNL
styled ones) on the source. However, the head and body are not rendered from
the page either. Am I missing something like the order of the filters, or a
filter itself? Please see the filter config in my web.xml:

    <filter>
        <filter-name>struts-cleanup</filter-name>
       
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
    </filter>

    <filter>
        <filter-name>Struts2</filter-name>
       
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>

   <filter>
        <filter-name>sitemesh</filter-name>
       
<filter-class>org.apache.struts2.sitemesh.FreeMarkerPageFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>struts-cleanup</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>Struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>sitemesh</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

Please advise.


Rosalia Lee wrote:
> 
> Hi,
> 
> I'm new to SiteMesh and have been trying to use SiteMesh, Struts 2 with
> SiteMesh Plugin and Java 5 for a project. I have been stucked with this
> problem for a couple days. Thanks in advance for your help.  It will be
> greatly appreciated! 
> 
> Problem: When I requested index.html or index.jsp, the result page was
> decorated, but it didn't show the contenct because the <decorator: head />
> and <docorator:body /> tags were not parsed or replaced with content in
> the requested page.
> 
> *************************************************** 
> This is my web.xml 
> 
> <web-app id="WebApp_9" version="2.4" 
> xmlns="http://java.sun.com/xml/ns/j2ee" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 
> 
> <display-name>Prototype Application</display-name> 
> 
> <filter> 
>   <filter-name>struts-cleanup</filter-name> 
>   <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filt
> er-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.FilterDispatcher</filter-c
> lass> 
> </filter> 
> 
> <filter-mapping> 
>   <filter-name>struts-cleanup</filter-name> 
>   <url-pattern>/*</url-pattern> 
> </filter-mapping> 
> <filter-mapping> 
>   <filter-name>sitemesh</filter-name> 
>   <url-pattern>/*</url-pattern> 
> </filter-mapping> 
> 
> <filter-mapping> 
>   <filter-name>struts2</filter-name> 
>   <url-pattern>/*</url-pattern> 
> </filter-mapping> 
> 
> <welcome-file-list> 
>   <welcome-file>index.html</welcome-file> 
>   <welcome-file>index.jsp</welcome-file> 
> </welcome-file-list> 
> </web-app> 
> 
> ***************************************** 
> This is my sitemesh.xml 
> 
> <sitemesh> 
>   <property name="decorators-file" value="/WEB-INF/decorators.xml" /> 
>   <excludes file="${decorators-file}" /> 
> 
>   <page-parsers> 
>     <parser content-type="text/html" 
>        class="com.opensymphony.module.sitemesh.parser.HTMLPageParser" /> 
>     <parser content-type="text/html;charset=ISO-8859-1" 
>       class="com.opensymphony.module.sitemesh.parser.HTMLPageParser" /> 
>   </page-parsers> 
> 
>   <decorator-mappers> 
>     <mapper
> class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper"> 
>        
>     </mapper> 
>   </decorator-mappers> 
> </sitemesh> 
> 
> ********************************** 
> baseTemplate.jsp (this is my decorator) 
> 
> <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator"
> prefix="decorator" %> 
> 
> <html> 
> <head> 
>   <title>Static Title from Decorator Page</title> 
>   <decorator:head /> 
> </head> 
> 
> <body> 
>   Static Text from Decorator Page 
> 
>   <decorator:body /> 
> </body> 
> </html> 
> 
> ***************************** 
> This is my index.html and index.jsp. (I tried both files, but neither
> work) 
> 
> <HTML> 
> <HEAD> 
> Header from requested page 
> </HEAD> 
> <BODY> 
> Directly under war dir. TESTING!!! 
> Click 
> </BODY> 
> </HTML>
> 
> Thanks for your help in advanace.
> 
> Rosalia
> 

-- 
View this message in context: http://www.nabble.com/Need-help%3A-%3Cdecorator%3Abody--%3E-not-parsed-tf4070536.html#a11677520
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message