New custom decorator mapper still defaults to ConfigDecoratorMapper class

120 views
Skip to first unread message

Ilyas Patel

unread,
Jun 4, 2012, 8:58:14 PM6/4/12
to SiteMesh 3 Users
I have created a custom decorator mapper and added to my sitemesh.xml
file. When I view the println statements it still defaults to
com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper class
which I am also using but not from my new mapper.

Looking through the SiteMesh code I couldn't understand why it is
defaulting to this class. I can't see where the parent values come
from. Does anyone else have any ideas?

-----

public final class PartnerDecoratorMapper extends
AbstractDecoratorMapper {
private String decorator = null;

public void init(Config config, Properties properties,
DecoratorMapper parent) throws InstantiationException {
super.init(config, properties, parent);
System.out.println("In init : " +
this.parent.toString()); // .mapper.ConfigDecoratorMapper@e736cbe
}

public Decorator getDecorator(HttpServletRequest request, Page
page) {
System.out.println("Decorator name : " +
super.getDecorator(request, page).getName()); // noSidebar
System.out.println("Decorator page : " +
super.getDecorator(request, page).getPage()); // /decorators/
noSidebar.jsp

return super.getDecorator(request, page);
}
}

-----

<mapper
class="com.efinancialcareers.myefc.core.filters.PartnerDecoratorMapper">
</mapper>

<mapper
class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">
<param name="config" value="${decorators-file}"/>
</mapper>


Thanks

Ilyas Patel

unread,
Jun 8, 2012, 7:01:26 AM6/8/12
to SiteMesh 3 Users
This actually turns out to be quite useful as I can use the Parent
decorator in my logic.
Reply all
Reply to author
Forward
0 new messages