Fixed it. There is a problem when you have a decorator with html extension. I dont know why but when I set it as jsp it works. Unfortunately there is not much documentation for thymeleaf and sitemesh in their websites or in the internet.
I think this should be enough to get started, I think spring and sitemesh filters intercept the call first, goes to the dispatcher which then forwards onto the sitemesh configuration and then loads the index page decorated by sitemesh, it took me a while to get working.
I will try and cut down my app into a little example for you soon (and I'll subscribe to the thread for updates!)
Thanks CWayman. I am using the older version of sitemesh so my config looks slightly different. As soon as I change the extension of layout/decorator file to html my pages become blank (empty response) without any exception/error.
I have cut down my app and created a sitemesh3 and thymeleaf example for you.
I am using google app engine to play around so there are some xml files for that in there too.
The app is all mavenized so in order to run it locally you should just need to do "mvn clean package gae:run" and then point your browser to http://localhost:8080 to see it all in action. It should suck down all the dependencies if you don't have them.
It's all very minimal just to show the decorator working while navigating between two pages but should be easily extendable using the thymeleaf-spring3 documentation on the site.
Hope you find it useful.
As these go I accept no responsibility for any consequences of using this demo blah blah blah, unless it's world peace, then I want all the credit! :)
With all the bits of the app in place currently it should be much work convert it to use sitemesh2. Maybe just an hours work.
I think you would need to change the package/name of the servlet used in the web.xml file.
rename the sitemesh3.xml file to sitemesh.xml
change the content into sitemesh 2 compliant configuration, but as we only have a reference to one decorator I think this would be simple.
and then change the tags in the decorator to be the V2 style.
and change the dependencies in the pom.xml
The spring configuration would be identical I believe.
I do agree for production systems you should probably use sitemesh2, the website does say as much, and it's probably something to be considered.
I am going to write the app up as a tutorial to be hosted on the thymeleaf site and I will include examples of both sitemesh2 and 3. It may be a little way away though as I am off on holiday from next Friday for two weeks.
So I think I may have been a little presumptuous there about sitemesh2. I decided to have a brief look before going to bed.
By the looks of things sitemesh2 uses a JSP tag library in order to do its processing meaning the decorators files will need to be JSPs.
If you can live without timeleaf tags in your decorator JSP page and just in the html files it includes then this should work for you. As such I've had to use JSP includes rather than thymeleaf fragments to import the header and footer.
It looks like you may need to create custom template resolvers (mentioned in the documentation) so that thymeleaf will also parse and convert any th attributes inside the JSP page too. The spring config for thymeleaf is successfully converting the html pages (because the suffix is html) but when viewing the source of the JSP page the th attributes were still present.