Thymeleaf 3.0.8 JUST PUBLISHED

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Thymeleaf 3.0.8 JUST PUBLISHED

danielfernandez
Administrator

Thymeleaf 3.0.8 (3.0.8.RELEASE) has been just published.

This is a maintenance release with some bugfixing and feature changes. It should work as a drop-in replacement for 3.0.x versions. Have a look at our Download Page to learn how to obtain it.

This is also the first GA version of the thymeleaf-spring5 integration module, that now depends on the very recent Spring Framework 5.0.0.RELEASE.


THYMELEAF 3.0.8 CHANGE LOG

Changes to the Thymeleaf CORE:

  • Fixed WebEngineContext returning wrong boolean values for ServletContextAttributesMap#isEmpty() and SessionAttributesMap#isEmpty().
  • Fixed DateFormat implementation being used for Jackson-based serialization of JavaScript dates not implementing clone() properly, which could result in thread-safety issues on the underlying SimpleDateFormat instance.
  • Fixed JavaScript parser failing on parsing JS regexp or JS template literals that contained unbalanced quotes.
  • Improved behaviour when parser-level or prototype-only comment block is not closed at the end of template. An exception is now thrown.
  • Updated SLF4j dependency to 1.7.25.

Changes to the Thymeleaf SPRING integration packages:

  • Fix RequestDataValueProcessor being called without a default action attribute (with GET value) for forms that included th:action, which resulted in CSRF token being added as a request parameter to the URL in some scenarios.
  • Added th:uerrors attribute in order to easily output all selected errors without escaping the error messages.
  • [thymeleaf-spring5] Added fullModeViewNames and chunkedModeViewNames properties to ThymeleafReactiveViewResolver so that the way the maxResponseChunkSize property is applied to templates can be fine-tuned. Templates can now be forced to be executed in FULL mode, or specific sets of templates can be selected to be the only ones executed as CHUNKED.
  • [thymeleaf-spring5] Improved DATA-DRIVEN mode behaviour so that it now causes a flush of the server's output channels for every output chunk produced (even if no max response chunk size has been set).
  • [thymeleaf-spring5] Added the SpringWebFluxContext class as a base implementation of ISpringWebFluxContext, useful for calling the SpringWebFluxTemplateEngine cleanly from outside a ThymeleafReactiveView.
  • [thymeleaf-spring5] Added the capability to set a prefix to the names and IDs of SSE events, so that HTML events coming from different executions of Thymeleaf in DATA-DRIVEN mode can be combined at the controller for UI composition in a single event stream and then easily discriminated at the JavaScript side by the corresponding EventSource objects.
  • [thymeleaf-spring5] Removed the ReactiveLazyContextVariable context variable wrapper in order to avoid confusion with the way lazy evaluation of non-data-driver reactive variables worked.
  • [thymeleaf-spring5] Set the default size of the buffers of elements generated by the data driver in DATA-DRIVEN mode to 10.
  • [thymeleaf-spring5] Updated Spring Framework dependencies to 5.0.0.RELEASE.
  • Updated SLF4j dependency to 1.7.25.

If you are interested, you can have a look at the list of issues on GitHub:

And of course we invite you to visit the project website at http://www.thymeleaf.org


SPECIAL NOTES FOR THE Spring 5 WebFlux INTEGRATION

How does Thymeleaf operate in a reactive-friendly way for Spring 5 WebFlux?

Like previous versions, this new version of the Spring 5 integration module includes updated support for the new Spring 5 WebFlux reactive web framework. When used with WebFlux, Thymeleaf can operate in one of three reactive-friendly modes:

  • Full, producing all output in memory and sending it as a single output buffer.
  • Chunked, producing output in buffers (chunks) of a configurable maximum size and sending them to the client as they are produced.
  • Data-Driven, making Thymeleaf work as an integrated part of a reactive stream of data, rendering HTML for the produced data in a way fully sensible to reactive back-pressure, sending HTML chunks of output to the client as data is produced (and optionally shaping this HTML chunks into SSE events).

Read more about these reactive-friendly operation modes at the thymeleaf-spring5 JavaDocs.

Also, note that there are three sandbox applications prepared to serve as examples of the general thymeleaf-spring5 integration with Spring 5 WebFlux:

  • thymeleafsandbox-stsm-reactive, equivalent to the STSM sample application but using Spring 5, Spring Boot 2.0 and the new Spring WebFlux framework. This sandbox is mainly meant to test form binding.
  • thymeleafsandbox-biglist-reactive, using Spring 5, Spring Boot 2.0 and the new Spring WebFlux framework. This sandbox is meant to test the rendering of large amounts of data.
  • thymeleafsandbox-sse-webflux, using Spring 5, Spring Boot 2.0 and the new Spring WebFlux framework. This sandbox is meant to test the rendering of Server-Sent Events (SSE) directly in HTML (no need for JSON parsing at the browser).

Regards,
Daniel.

Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf 3.0.8 JUST PUBLISHED

dasa
Great news!!

Are there any changes in th:errors?

Before upgrading from 3.0.7 th:errors="*{fieldname}" shows the error of the specified field.
With 3.0.8 no error-content is rendered. Using th:error="*{fieldname}" instead works.

API change or bug?

Many thanks and best regards.
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf 3.0.8 JUST PUBLISHED

danielfernandez
Administrator
Hello dasa,

There have been no changes to th:errors, and actually there is no such "th:error" attribute processor neither in 3.0.7 nor in 3.0.8. Could you please re-check this scenario and, if you confirm your issue, please add a GitHub ticket giving the most detail possible? (version of Spring, etc.)

Thanks,
Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf 3.0.8 JUST PUBLISHED

dasa
Hello Daniel,

thank your for your fast check and reply.

Strage, i re-checked the scenario - th:errors does not work for a single field error, only for global errors - th:error works for a field error ... somewhat magic ...

My setup:
- Tomcat 8.5.20

- Spring 5.0.0.Release
- Spring Security 4.2.3.RELEASE (also testet with 5.0.0.M3)

- Thymeleaf 3.0.8.RELEASE
- thymeleaf-spring5 3.0.8.RELEASE
- thymeleaf-layout-dialect 2.2.2
- thymeleaf-extras-springsecurity4 3.0.2.RELEASE (cuurently there is no 5 version available)

Because we are moving from Spring 4 to Spring 5 upgrade to Thymeleaf 3.0.8 is needed.
I will try a setup with Spring 4 and Tyhmeleaf 3.0.8 and 3.0.7 to check if it is a Spring 4/5 or an Thymleaf issue.

Best regards
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf 3.0.8 JUST PUBLISHED

dasa
Hello Daniel,

after debugging a while, i found that this has nothing to do with Thymeleaf, it is an changed behaviour of Spring 5 Message resolving mechanism that returns an empty string (not a null value) by asking the ParentMessageSource if the actual MessageResolver does not find a message for a given code.

Additionally: th:error does not exists (your right!) and simply does nothing but leafs the default text in the html-template (which looks like the th:error has done his job ...)

Sorry for my misunderstanding !

Best Regards.