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 cannot evaluate SpEL expressions #2076

Closed
eleftherias opened this issue Apr 29, 2022 · 1 comment
Closed

Thymeleaf cannot evaluate SpEL expressions #2076

eleftherias opened this issue Apr 29, 2022 · 1 comment
Assignees
Labels
in: docs An issue in Documentation or samples type: bug A general bug
Milestone

Comments

@eleftherias
Copy link
Contributor

After upgrading to Spring Boot 3, Thymeleaf cannot resolve #httpServletRequest or #httpSession.
It's not clear yet if this is a bug or a misconfiguration in the samples.

For this reason, many Spring Boot samples are disabled.
They should be re-enabled when this is fixed.

@eleftherias eleftherias added type: bug A general bug in: docs An issue in Documentation or samples labels Apr 29, 2022
@eleftherias eleftherias added this to the 3.0.0-M2 milestone Apr 29, 2022
@eleftherias eleftherias self-assigned this Apr 29, 2022
eleftherias added a commit that referenced this issue Apr 29, 2022
The Spring Boot servlet samples remain disalbed because of gh-2076.
@rwinch rwinch assigned rwinch and unassigned eleftherias May 13, 2022
@rwinch
Copy link
Member

rwinch commented May 13, 2022

The issue is that httpServletRequest and other expression utility objects are no longer available. We need to manually add them to the model using something like @ModelAttribute.

I'm going to update the samples to use @ModelAttribute and @ControllerAdvice to expose the necessary properties.

rwinch added a commit that referenced this issue May 18, 2022
Thymeleaf removed support for accessing the HttpServletRequest and HttpSession
automatically, so we need to add any properties we want to access as ModelAttributes

Closes gh-2076
@rwinch rwinch closed this as completed May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: docs An issue in Documentation or samples type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants