In this short Q&A article, we are going to show how to get URL request parameters in Thymeleaf template view.
Luckily, request parameters can be easily accessed in Thymeleaf views using built-in tools.
For request parameters like in the following URL:
In order to access
query parameter we could use the
Another way to access URL parameters is by using the special
#request object that gives you direct access to the
Note that parameters could be multivalued like in the following example:
In this case we need to use an index of the array:
To iterate over array we could use