Message from discussion
Please let us know how to register decorators excludes
Received: by 10.224.210.193 with SMTP id gl1mr247953qab.2.1311873770742;
Thu, 28 Jul 2011 10:22:50 -0700 (PDT)
X-BeenThere: sitemesh3-users@googlegroups.com
Received: by 10.224.174.195 with SMTP id u3ls5393092qaz.6.gmail; Thu, 28 Jul
2011 10:22:49 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.224.35.68 with SMTP id o4mr76603qad.0.1311873769731; Thu, 28
Jul 2011 10:22:49 -0700 (PDT)
Received: by 15g2000vbw.googlegroups.com with HTTP; Thu, 28 Jul 2011 10:22:49
-0700 (PDT)
Date: Thu, 28 Jul 2011 10:22:49 -0700 (PDT)
In-Reply-To: <3fa6b44f-a6be-47b6-8a42-2546b7976262@h21g2000pre.googlegroups.com>
References: <3fa6b44f-a6be-47b6-8a42-2546b7976262@h21g2000pre.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0,gzip(gfe)
Message-ID: <d9703543-397a-4348-babc-f01cf1eec157@15g2000vbw.googlegroups.com>
Subject: Re: Please let us know how to register decorators excludes
From: Shaunak Khedkar <shaunakkhed...@gmail.com>
To: SiteMesh 3 Users <sitemesh3-users@googlegroups.com>
Content-Type: text/plain; charset=EUC-KR
Content-Transfer-Encoding: quoted-printable
Hi Kim,
I had the same problem a few days ago, where I wanted to exclude a
particular page being affected by decorator. Following is the
solution:
Apply the decorator to all the pages by using:
<mapping path=3D"/*" exclude=3D"false" decorator=3D"/decorator.jsp"/>
And to exculde a particular page from being decorated by the
decorator, add <%@ page contentType=3D"application/json" %> to the page.
(I have used contentType=3D"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 27, 11:24 pm, MJ KIM <kmj6...@gmail.com> wrote:
> I have created a spring mvc project.
>
> My folder structure is as follows:
>
> webapp
> =A4=A4decorators
> =A4=A4 main.jsp
> =A4=A4 resources
> =A4=A4 WEB-INF
> =A4=A4 views
> =A4=A4 main
> =A4=A4 today_main.jsp
> =A4=A4 decorators.xml
>
> I would like to exclude today_main.jsp to sitemesh.
>
> -------------------------------------------------------------------------=
------------------------------------------
> decorators.xml
> <?xml version=3D"1.0" encoding=3D"ISO-8859-1"?>
>
> <decorators defaultdir=3D"/decorators">
>
> <excludes>
> <pattern>../WEB-INF/view/main/today_main.jsp</pattern>
> </excludes>
>
> <decorator name=3D"main" page=3D"/decorators/main.jsp">
> <pattern>/*</pattern>
> </decorator>
> </decorators>
> -------------------------------------------------------------------------=
-----------------------------------------
>
> But in today_main.jsp not exclude sitemesh.
> I used the wrong <pattern> is?
>