Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Sitemesh - excludes

807580Feb 5 2010
Hi,

web.xml
<servlet>
		<servlet-name>sitemesh-velocity</servlet-name>
		<servlet-class>com.opensymphony.module.sitemesh.velocity.VelocityDecoratorServlet</servlet-class>
		<init-param>
			<param-name>org.apache.velocity.properties</param-name>
			<param-value>/WEB-INF/velocity.properties</param-value>
		</init-param>
	</servlet>
	<servlet-mapping>
		<servlet-name>sitemesh-velocity</servlet-name>
		<url-pattern>*.vm</url-pattern>
	</servlet-mapping>
	
	<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>
	    <dispatcher>FORWARD</dispatcher>
	</filter-mapping>
{code}*sitemesh.xml*
{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<sitemesh>
	<property name="decorators-file" value="/WEB-INF/decorators.xml"/>
	<excludes file="${decorators-file}"/>
	<page-parsers>
		<parser default="true"
		class="com.opensymphony.module.sitemesh.parser.FastPageParser"/>
		<parser content-type="text/html"
		class="com.opensymphony.module.sitemesh.parser.FastPageParser"/>
		<parser content-type="text/html;charset=ISO-8859-1"
		class="com.opensymphony.module.sitemesh.parser.FastPageParser"/>
	</page-parsers>
	
	<decorator-mappers>
		<mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">
			<param name="config" value="${decorators-file}"/>
		</mapper>
	</decorator-mappers>
</sitemesh>
{code}*decorators.xml*
{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<decorators defaultdir="/WEB-INF/decorators">
    <decorator name="main" page="main.vm">
    	<excludes>
        	<pattern>/ajax/*</pattern>
        </excludes>
        <pattern>/WEB-INF/velocity/*</pattern>
    </decorator>
</decorators>
{code}
I need that AjaxController doesnt be decorated with sitemesh, cause my ajax return will be pushed there. I tried to use another patterns, like +/ajax/ajax.vm, /ajax/, /WEB-INF/velocity/ajax*+

What's wrong?

Regards,
Andr&eacute; Vendramini                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 5 2010
Added on Feb 5 2010
0 comments
162 views