Vivek
Vivek

Reputation: 1461

sitemesh excluding trouble

This is my sitemesh-decorators.xml file content

<decorators defaultdir="/WEB-INF/sitemesh">
    <excludes>
        <pattern>*.html*</pattern>
        <pattern>*.json*</pattern>
        <pattern>*.xml*</pattern>
        <pattern>*.download*</pattern>
        <pattern>/WEB-INF/views/dashboard/dashboard.jsp</pattern>
    </excludes>

    <decorator name="minimal" page="minimal.jsp">
        <pattern></pattern>
    </decorator>

    <decorator name="none" page="none.jsp">
        <pattern></pattern>
    </decorator>

    <decorator name="default" page="default.jsp">
        <pattern>*</pattern>
    </decorator>

</decorators>

But the dashboard is not excluded, any ideas, I have tried to change the pattern for the 'default' tag as well by adding individual pages but no effect.

I have also tried to enter the exclude jsp page in the 'none' tag as well. Does anyone have any experience with customising it?

Upvotes: 0

Views: 7133

Answers (3)

user7762821
user7762821

Reputation: 1

We can add it like this:

<mapping path="/Login" exclue="true"/>

see http://wiki.sitemesh.org/wiki/display/sitemesh3/Configuring+SiteMesh+3

Upvotes: -1

v11
v11

Reputation: 2234

I have the same problem,and I solved is by this way that adding a new decorator named "no":

<?xml version="1.0" encoding="UTF-8"?>
<decorators defaultdir="/WEB-INF/layouts/">
    <excludes>
        <pattern>/static/*</pattern>
        <pattern>/api/*</pattern>
        <pattern>/</pattern>
    </excludes>
    <decorator name="default" page="default.jsp">
        <pattern>/*</pattern>
    </decorator>
    <decorator name="no" page=""></decorator>
</decorators>

and add the meta to your page that does not want to use decorator:

<meta name="decorator" content="no" />

Upvotes: 1

Vivek
Vivek

Reputation: 1461

I altered my sitemesh-decorator.xml to

<decorators defaultdir="/WEB-INF/sitemesh">
    <excludes>
        <pattern>*.html*</pattern>
        <pattern>*.json*</pattern>
        <pattern>*.xml*</pattern>
        <pattern>*.download*</pattern>
    </excludes>

    <decorator name="minimal" page="minimal.jsp">
        <pattern></pattern>
    </decorator>

    <decorator name="none" page="none.jsp">
        <pattern></pattern>
    </decorator>

    <decorator name="default" page="default.jsp">
        <pattern>*</pattern>
    </decorator>

    <decorator name="dashboard" page="/WEB-INF/views/dashboard/dashboard.jsp"/>

</decorators>

and used

<meta name="decorator" content="dashboard">

in my dashboard.jsp's head and it did the trick.

Is this the best way?

Upvotes: 2

Related Questions