Dashboard > SiteMesh > Index > Integration with Spring
  SiteMesh Log In View a printable version of the current page.  
  Integration with Spring
Added by Ben Alex, last edited by Ben Alex on May 30, 2004  (view change)
Labels: 
(None)

Some classes to assist integrate Sitemesh into a Spring application context. This includes a new SiteMesh Factory, a Spring-compatible decorator and decorator factory, and a supporting property editor.

The attached file contains web.xml and applicationContext.xml fragments required to use the classes.

To explain our motivation for the classes, our application needs to support different decorator configurations for different clients. As we're already using Spring to store client-specific configuration, having SiteMesh obtain its decorators (and broader configuration) from Spring makes sense. This allows us to use the existing Spring configuration mechanisms such as PropertyPlaceholderConfigurer, custom database-backed application contexts etc.

We're also using WebDAV and would like decorators to be able to detect whether a certain file is available via WebDAV. For example, the AgentDecoratorMapper would need to see if a WebDAV-backed file is available. As our WebDAV environment is also housed in Spring, the attached classes enable these collaborator beans to be used directly.

Hope this is of use to everyone.

Ben Alex
Acegi Technology

IF THE ATTACHMENT APPEARS TO BE CORRUPT: It is a browser issue, so try using a different browser. Mozilla Firefox and wget both work fine.

Ben,

I use SiteMesh on a couple of Spring based projects. One of the advantages is that requests not handled by the Spring dispatcher such as static content can still be decorated the same way. Without having looked through your code (I will toinight!) how would you handle this? I'm assuming you wouldn't and would stick with standard SiteMesh configuration...?

Interesting stuff by the sounds of it anyway.

Darren Davison
(Spring team)

Posted by Anonymous at May 13, 2004 07:05 | Permalink
Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators