eiswind/magnolia-blossom-thymeleaf-proto — pull request #3 by pphillips-techphob (2014-02-12 08:24:42+00:00)
Title: Rewrite to sort out direct component rendering and spring web context

This pull request fixes two main problems we encountered:

* Direct component rendering was not supported by the !ThymeleafRenderer, e.g. rendering of /homePage/Area/0 would fail as "templates/main.html :: component" was unrecognised.
* The same spring web context was being used for the components as the page by Thymeleaf so when rendering field errors (e.g. #fields.hasGlobalErrors()) it would use the page context and not find the errors.

The fix for the first issue was fairly simple, I added fragment support to the !ThymeleafRenderer in the same way as the Processors had support for it. The second problem was caused by the area and component processing not going through the Blossom servlet like it did in Freemarker. Therefore I've switched to the standard Magnolia area and component elements which then call through to Blossom to the !ThymeleafRenderer and then use a Thymeleaf macro to add the result into the Thymeleaf tree.

Note that therefore the blossom-servlet wildcard matching is *.html*, which allows fragments to be specified for the view.