Repository navigation
SiteMesh 3.3.0 — Java 17+, Jakarta EE 11 (Servlet 6.1), Jetty 12, Tomcat 11, and Spring Boot 4.x.
Available on Maven Central:
runtimeOnly 'org.sitemesh:sitemesh-webfilter:3.3.0' // servlet apps: registers the filter itself, no web.xml
runtimeOnly 'org.sitemesh:spring-boot-starter-sitemesh:3.3.0' // Spring BootThe core org.sitemesh:sitemesh artifact on its own registers no filter; use it when you declare the filter in web.xml, subclass ConfigurableSiteMeshFilter, or run SiteMesh offline.
Upgrading from 3.2.x
- The Spring Boot starter now decorates through Spring MVC's view resolution by default, not the servlet filter. A single non-invasive delegating resolver (
sitemesh.viewResolver.wrapMode=delegate) decorates what yourViewResolverbeans resolve. This avoids response buffering and theforward()problems of filter-based decoration on Tomcat 11+, and makes SiteMesh work with frameworks such as Grails. If your app relied on the filter, for example to decorate static.htmlfiles or other non-MVC content, setsitemesh.integration=filter. SeeCONFIGURATION.md. sitemesh.*properties are bound through a typedSiteMeshPropertiesclass.sitemesh.integration,sitemesh.dispatchModeandsitemesh.viewResolver.wrapModeare enums, so an unrecognised value fails startup instead of being silently ignored.- Byte-written content without a declared charset is decoded as UTF-8, not the platform default, and the decorated result is written back in that charset. On Tomcat, decorated static pages are now served as UTF-8 rather than ISO-8859-1. A declared charset still wins.
- Offline mode reads and writes files as UTF-8 (
FileSystemDirectory,InMemoryDirectory, the CLI and Ant), unless a charset is passed explicitly. setTagRuleBundles(...)replaces the default bundles, as its javadoc always said, instead of adding to them.<mapping decorator="a.html, b.html">in XML is a chain of two decorators, as it already was with the meta tag and the Spring Boot properties.- Replacing the decorator selector keeps mappings configured before it.
- Auto-reload checks
sitemesh3.xmlat most once a second instead of on every request. - If you tried a milestone: the
wrapMode=allmode from 3.3.0-M1 was removed in favour ofdelegate, and setting it now fails startup.
What's new
Containers
- Jakarta EE 11 / Servlet 6.1 support on Tomcat 11 and Jetty 12. The response wrappers handle
ServletOutputStream.write(ByteBuffer)andsetContentLengthLong(long), which newer containers use and which otherwise bypassed SiteMesh's buffer. - Configurable dispatch to the decorator:
include,forwardordetect(the default, which usesinclude()on Tomcat 11+ andforward()elsewhere). Set it withSiteMeshFilterBuilder.setDispatchMode(...),<dispatch-mode>,dispatchModeorsitemesh.dispatchMode.
Spring Boot 4 starter
- View-resolver integration with three wrap modes (
delegate,bean-definition,bean-instance). Decorators named without a leading/render through theViewResolverchain, with noRequestDispatcherinvolved. - Multi-engine apps (Thymeleaf, FreeMarker, JSP side by side) are decorated correctly, including JSP on Tomcat 11, and only HTML is ever decorated.
- Decorator chaining in Spring Boot decorator mappings.
- Configuration metadata for IDE auto-completion, and public
@ConditionalOnSiteMeshIntegration/@ConditionalOnSiteMeshWrapModeannotations so framework integrations can share the starter's conditions.
Performance
- Writing the output no longer makes an intermediate String copy: allocation per decorated request is down 34% (ASCII) to 47% (non-Latin-1).
- Byte-written content (static files) is copied in bulk and decoded once, in place: write plus decode of a 16 KB page went from 18.3 to 2.35 µs.
- Render buffers are sized from what earlier renders of the same view measured.
Fixes
java -jar sitemesh.jarworks again, and offline mode honours<decorator-prefix>and<decorator-selector>.- XML configuration: multi-path
excludemappings, pretty-printed values, and absoluteconfigFilepaths on Tomcat. - Case conversions no longer depend on the JVM locale, a byte-written response larger than 16 MB no longer overflows the buffer, and the startup log reports the real SiteMesh version.
sitemesh3.xsdis rewritten to match what SiteMesh reads.
The RC1, RC2 and RC3 notes list every change in detail.
Examples and build
- New Struts and Micronaut examples, both decorating without the servlet filter, alongside the servlet/JSP, Spring Boot and Javalin examples.
- CI runs the tests on JDK 17, 21 and 25, runs the Spring Boot example on Jetty, and boots every example on Tomcat and Jetty before anything is published.
Changes since 3.3.0-RC3
None to the library. The Struts example moves to 7.4.0 and the Micronaut example to platform 5.2.1, and the README now points at 3.3.0 and the Central snapshot repository.
Full changelog: 3.2.3...3.3.0