Hi Stanilas,
Please have a look at the following:
Problem Resolved. Apply the decorator to all the pages by using:
<mapping path="/*" exclude="false" decorator="/decorator.jsp"/>
And to exculde a particular page from being decorated by the
decorator, add <%@ page contentType="application/json" %> to the page.
(I have used contentType="applicaion/json" because I need it. You can
put others as well but not "text/html")
This is because By default, SiteMesh will only intercept responses
that set the Content-Type HTTP header to text/html.
Please refer the following site,
http://www.sitemesh.org/configuration.html and see for this section:
Advanced Configuration:
For most users, the decorator mappings above should be enough. But if
you want more options...
MIME Types
By default, SiteMesh will only intercept responses that set the
Content-Type HTTP header to text/html.
This can be altered to allow SiteMesh to intercept responses for other
types. This is only applicable for the SiteMesh Filter - it is ignored
by the offline site builder.
Thanks!!
On Jul 7, 6:40 pm, "stani...@yahoo.fr" <stani...@yahoo.fr> wrote:
> hi sitemesh develloper
> i need some help
> i want to exclude one file but i dont sucess :/
> sitemesh working good all my file is decoratinf
> my sitemesh3.xml
> <sitemesh>
> <excludes> <pattern>/index.jsp</pattern></excludes>
> <mapping path="/*" decorator="/decorator/decorator.jsp"></mapping>
> </sitemesh>
> my decorator.jsp model
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
> pageEncoding="ISO-8859-1"%>
> <%@ taglib prefix="s" uri="/struts-tags" %>
> <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
> <%@ taglib prefix="menu" uri="http://struts-menu.sf.net/tag-el"%>
> <html>
> <head>
> <title>SiteMesh example: <sitemesh:write property='title'/></
> title>
> <style type='text/css'>
> /* Some CSS */
> body { font-family: arial, sans-serif; background-color:
> #ffffcc;}
> h1, h2, h3, h4 { text-align: center; background-color: #ccffcc;
> border-top: 1px solid #66ff66; }
> .mainBody {height:"100%"; width:"80%" ; border: 1px solid
> #555555; }
> .disclaimer { text-align: center; border-top: 1px solid #cccccc;
> margin-top: 40px; color: #666666; }
> .menu{float:left;witdh:"20%"; height:100%; margin-right:5% }
> </style>
> <sitemesh:write property='head' width="30%" height="100%"/>
> </head>
> <body>
> <h1 class='title'>SiteMesh example site: <sitemesh:write
> property='title'/></h1>
> <div>
> <div id="menu" class="menu">
> <menu:useMenuDisplayer name="TabbedMenu"
> bundle="Global" >
> <menu:displayMenu name="Global.Home" />
> <menu:displayMenu name="Global.About" />
> </menu:useMenuDisplayer>
> </div>
> <div class='mainBody'>
> <sitemesh:write property='body'/>
> </div>
> </div>
> <div class='disclaimer'>Site disclaimer. This is an example.</div>
> </body>
> </html>
> 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/j2eehttp://java.sun.com/xml/ns/j2ee/web-ap...">
> <display-name>examplestrust</display-name>
> <filter>
> <filter-name>struts2</filter-name>
> <filter-
> class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter </
> filter-class>
> </filter>
> <filter-mapping>
> <filter-name>struts2</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
> <listener>
> <listener-class>net.sf.navigator.menu.MenuContextListener</
> listener-class>
> </listener>
> <filter>
> <filter-name>sitemesh</filter-name>
> <filter-class>org.sitemesh.config.ConfigurableSiteMeshFilter</
> filter-class>
> </filter>
> <filter-mapping>
> <filter-name>sitemesh</filter-name>
> <url-pattern>/*</url-pattern>
> <dispatcher>REQUEST</dispatcher>
> <dispatcher>FORWARD</dispatcher>
> <dispatcher>INCLUDE</dispatcher>
> </filter-mapping>
> <welcome-file-list>
> <welcome-file>/index/index.jsp</welcome-file>
> </welcome-file-list>
> </web-app>
> somebodu help me please :(.