pamlwong
Mar 9th, 2011, 01:12 AM
I was configuring SiteMesh with Spring 3. I succesfully configure SiteMesh with Spring 3, but the problem is when i trying to exclude some JSPs from the SiteMesh.
The example i show below , both pattern /WEB-INF/jsp/help & /WEB-INF/jsp/help.jsp is not working and it wouldnt exclude the SiteMesh decorations for me.
Please advice!
This is my decorators.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<decorators defaultdir="/WEB-INF/decorators">
<excludes>
<pattern>/WEB-INF/jsp/help</pattern>
<pattern>/WEB-INF/jsp/help.jsp</pattern>
</excludes>
<decorator name="main" page="mainDecorators.jsp">
<pattern>/*</pattern>
</decorator>
</decorators>
This is my web.xml
<!-- SiteMesh configuration, check out decorators.xml -->
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
This is my servlet.xml on configure viewResolver(i dono this will effect anything or not)
<!-- Prepend /WEB-INF/jsp/ and append .jsp to the logical view name -->
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResou rceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
The example i show below , both pattern /WEB-INF/jsp/help & /WEB-INF/jsp/help.jsp is not working and it wouldnt exclude the SiteMesh decorations for me.
Please advice!
This is my decorators.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<decorators defaultdir="/WEB-INF/decorators">
<excludes>
<pattern>/WEB-INF/jsp/help</pattern>
<pattern>/WEB-INF/jsp/help.jsp</pattern>
</excludes>
<decorator name="main" page="mainDecorators.jsp">
<pattern>/*</pattern>
</decorator>
</decorators>
This is my web.xml
<!-- SiteMesh configuration, check out decorators.xml -->
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
This is my servlet.xml on configure viewResolver(i dono this will effect anything or not)
<!-- Prepend /WEB-INF/jsp/ and append .jsp to the logical view name -->
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResou rceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>