Skip to content

3.3.0-RC2

Pre-release
Pre-release

Choose a tag to compare

@codeconsole codeconsole released this 26 Sep 05:43
· 13 commits to master since this release

Second release candidate for 3.3.0 — Java 17+, Jakarta EE 11 (Servlet 6.1), Jetty 12, Tomcat 11, Spring Boot 4.x.

Available on Maven Central:

runtimeOnly 'org.sitemesh:sitemesh-webfilter:3.3.0-RC2'            // servlet apps: registers the filter itself, no web.xml
runtimeOnly 'org.sitemesh:spring-boot-starter-sitemesh:3.3.0-RC2'  // Spring Boot

The 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.

Behavior changes since 3.3.0-RC1

Check these when upgrading from RC1 (or from 3.2.x):

  • Charset of byte-written content. Content written through getOutputStream() without a charset in its content type (static files on Tomcat, for example) is now decoded as UTF-8 instead of the platform default, and SiteMesh now writes the decorated result in that same charset. On Tomcat, decorated static pages are therefore declared and encoded as UTF-8 rather than ISO-8859-1, which had turned every character outside Latin-1 into ?. A declared charset still wins.
  • sitemesh.integration is an enum. An unrecognised value now fails startup instead of silently switching SiteMesh off, and relaxed spellings (VIEW_RESOLVER, viewResolver) now work. SiteMeshProperties.getIntegration() returns SiteMeshProperties.Integration.
  • setTagRuleBundles(...) replaces the default bundles, as its javadoc always said, instead of adding to them.
  • XML decorator chains. <mapping decorator="a.html, b.html"> is now a chain of two decorators, as with the meta tag and the Spring Boot properties.
  • Replacing the decorator selector keeps earlier mappings. Setting a path-based selector (<decorator-selector>, decoratorSelector, setCustomDecoratorSelector) used to discard mappings configured before it. A replacement selector still gets no default /WEB-INF/decorators/ prefix unless one is set.
  • Auto-reload checks sitemesh3.xml at most once a second instead of on every request.
  • A byte-written response that declares an unsupported charset now fails when it is decoded for processing; for an async request that is in the async listener rather than doFilter.

Fixes

Spring Boot starter

  • sitemesh.view-resolver.wrap-mode (the kebab-case form IDEs suggest) and upper-case values such as BEAN_INSTANCE were ignored, silently registering the wrong resolver or none. This affected Grails' bean-instance mode.
  • In filter mode, a mapping missing its path or decorator failed startup, or every request under the path; such entries are now skipped with a warning, as in view-resolver mode.

Configuration

  • An exclude mapping with several <path> elements excluded only the first.
  • Pretty-printed XML values (<path> on its own line, etc.) are now trimmed; they never matched before.
  • <decorator-prefix> and <decorator-selector> now apply in offline mode (CLI and Ant).
  • includeErrorPages in init-params accepts TRUE/yes, like the XML, and false can now override an earlier true.
  • New decoratorPrefix init-param / CLI property.
  • Warnings instead of silence for an unknown dispatch mode, a dropped decoratorMappings entry, and a named configFile that cannot be found.
  • An absolute configFile path is now found on Tomcat.
  • Deleting sitemesh3.xml no longer rebuilds the filter on every request.
  • Case conversions no longer depend on the JVM locale (under Turkish, an upper-case <TITLE> was not extracted and dispatch-mode=include was ignored).

Response buffering

  • Undecorated byte content is written back in the charset it was decoded with, not the JVM default.
  • A byte-written response of more than 16 MB could throw BufferOverflowException.

Command line and Ant

  • java -jar sitemesh.jar works again; the Main-Class manifest entry had been lost when the build moved from Maven to Gradle.
  • A sitemeshfileset's decorator now applies to its files (it silently didn't unless the include began with a wildcard), and two NullPointerExceptions are fixed.

Documentation

  • The install docs and QUICKSTART now use sitemesh-webfilter for zero-config installs; the QUICKSTART works again on Tomcat 11.
  • sitemesh3.xsd is rewritten to match the configuration SiteMesh reads (the old schema never compiled).
  • The servlet filter's include-error-pages default is documented correctly as false (the Spring Boot starter's is true).

Performance

Measured with JMH on JDK 17, on a 50 KB page unless stated:

  • Writing the output no longer makes an intermediate String copy: the write step is 3.7× faster for ASCII, and allocation per decorated request is down 34% (ASCII) to 47% (non-Latin-1).
  • Buffering static files (content written as bytes) copies in bulk and decodes in place: write plus decode of a 16 KB page went from 18.3 to 2.35 µs (−87%), with 25% less allocation. Byte-written responses are also decoded once instead of twice.
  • Auto-reload no longer checks the config file's timestamp on every request.

Build and testing

  • CI also runs the tests on JDK 21 and 25, and the Spring Boot example on Jetty.
  • examples/smoke-test.sh boots every example on Tomcat and Jetty (and Spring Boot in both integrations) and checks that pages are decorated.
  • Sources are compiled as UTF-8.
  • Spring Boot 4.1.1, Micronaut platform 5.1.5, Gradle 9.8.0.

Please report anything that regressed against 3.2.x or 3.3.0-RC1 before 3.3.0 ships.

Full Changelog: 3.3.0-RC1...3.3.0-RC2