Please let us know how to register decorators excludes

347 views
Skip to first unread message

MJ KIM

unread,
Jul 28, 2011, 2:24:27 AM7/28/11
to SiteMesh 3 Users
I have created a spring mvc project.


My folder structure is as follows:

webapp
ㄴdecorators
ㄴ main.jsp
ㄴ resources
ㄴ WEB-INF
ㄴ views
ㄴ main
ㄴ today_main.jsp
ㄴ decorators.xml


I would like to exclude today_main.jsp to sitemesh.

-------------------------------------------------------------------------------------------------------------------
decorators.xml
<?xml version="1.0" encoding="ISO-8859-1"?>

<decorators defaultdir="/decorators">

<excludes>
<pattern>../WEB-INF/view/main/today_main.jsp</pattern>
</excludes>

<decorator name="main" page="/decorators/main.jsp">
<pattern>/*</pattern>
</decorator>
</decorators>
------------------------------------------------------------------------------------------------------------------

But in today_main.jsp not exclude sitemesh.
I used the wrong <pattern> is?

Please let us know how what to used.




Shaunak Khedkar

unread,
Jul 28, 2011, 1:22:49 PM7/28/11
to SiteMesh 3 Users
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="/*" 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!!

max max

unread,
Jul 28, 2011, 1:37:53 PM7/28/11
to sitemes...@googlegroups.com
you can choose an other option you map the page you want to decorate :).
i use this method and i wait an answer but i think the excludes work only for a folder.

--- En date de : Jeu 28.7.11, Shaunak Khedkar <shaunak...@gmail.com> a écrit :

Reply all
Reply to author
Forward
0 new messages