question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Release 3.0.12 has broken most of our templates due to #809

See original GitHub issue

Due to changes in https://github.com/thymeleaf/thymeleaf/issues/809 we have a lot of templates that are now broken.

For a lot of our templates we use static members in our Spring controllers for the request names. Hrefs within our templates look like the following:

<a th:href="@{${T(com.test.controller.DashboardController).REQUEST_DASHBOARD}}">

This now results in the following exception:

org.thymeleaf.exceptions.TemplateProcessingException: Instantiation of new objects and access to static classes is forbidden in this context

This pattern is used in 100’s of templates in our code base. We obviously don’t want to completely disable the restricted expression evaluation mode, but is there a way to turn off the restriction of just the static class access?

Thanks, Scott

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:35
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

19reactions
ddelamottecommented, Mar 2, 2021

+1 Many of my templates are broken due to this “minor”?? update. It looks like a breaking change to me and should not have been embedded within a minor version update…

11reactions
scoldwellcommented, Mar 8, 2021

@danielfernandez can you comment on this issue? Seems to be a major problem for many people

Read more comments on GitHub >

github_iconTop Results From Across the Web

thymeleaf - Bountysource
Due to changes in https://github.com/thymeleaf/thymeleaf/issues/809 we have a lot of templates that are now broken. For a lot of our templates we use...
Read more >
cookiecutter Documentation - Read the Docs
We're so pleased that there are many Cookiecutter project templates to choose from. We hope you find a cookiecutter that is just right...
Read more >
Static classes or parameters is forbidden in thymeleaf 3.0.12
Thymeleaf 3.0.12 이후의 버전에서는 아래와 같은 오류가 발생한다. ... Release 3.0.12 has broken most of our templates due to #809 · Issue #816 ......
Read more >
Thymeleaf 3.0.15 — Release Notes
This is a highly recommended security update with some bugfixing and feature changes. Security improvements: Fixed inconsistent restricted ...
Read more >
History — cookiecutter 2.1.1 documentation
Upgrade flake8 to version 3.5.0, thanks to @cclauss (#1038). Update tutorial with explanation for how cookiecutter finds the template file, thanks to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found