From looking at the thymeleaf documentation, I've tried to access web context objects with thymeleaf in my Spring boot project in this manner:
<p th:text="${#request.getRequestURL()}">lol</p>
which results in the following exception:
org.springframework.expression.spel.SpelEvaluationException: EL1011E: Method call:
Attempted to call method getRequestURL() on null context object
From this error it seems that I might be missing a dependency? I've seen a similar question, where the solution was to add an extras
thymeleaf package as a dependency.
However, it is stated in the thymeleaf documentation that these objects and variable maps are always available to be invoked so I guess that shouldn't be the case here.
I'm using the release 1.5.1 of spring-boot-starter-thymeleaf
as well as a number of other spring-boot-starter
packages like web
and security
.