Forward port of issue #24599 to 2.4.x.

Comment From: mschneid

This upgrade breaks a lot of our templates, as described here: https://github.com/thymeleaf/thymeleaf/issues/816

Comment From: wilkinsona

Thanks for letting us know, @mschneid. It's unfortunate, but there's not much we can do. We try to avoid downgrading dependencies as we don't want to get stuck on an old version. If an older version works better for you, you can downgrade yourself by using the thymeleaf.version property.

Comment From: subotaii

This upgrade also breaks all our forms as described here: https://github.com/thymeleaf/thymeleaf-spring/issues/255