Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thymeleaf no longer processes results of standard Java stream methods #972

Open
d4span opened this issue Aug 21, 2023 · 1 comment
Open

Comments

@d4span
Copy link

d4span commented Aug 21, 2023

After a recent upgrade of Spring Boot and Thymeleaf to version 3.1.1 and 3.1.2, respectively, we are suddenly experiencing exceptions of the following type in several Thymeleaf templates that worked fine before the upgrade:

org.springframework.expression.EvaluationException: Accessing member 'isEmpty' is forbidden for type 'class java.util.ImmutableCollections$ListN' in Thymeleaf expressions. 
Blocked classes are: [...]. Allowed classes are: [...].

The collection causing this issue results from a standard Java Streams .toList() method invocation.

Is there a way to configure the list of allowed classes to avoid these issues with results of core library methods?

@d4span d4span changed the title Thymeleaf no longer processes results from standard Java stream methods Thymeleaf no longer processes results of standard Java stream methods Aug 21, 2023
@jmiguelsamper
Copy link
Member

Hi @d4span ,

Could you check that your templates contain invocations of "isEmpty()" instead of just "isEmpty" (without parenthesis).

I came with the same error this morning and the cause was the missing parenthesis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants