I have the following separated fragment in a Thymeleaf template.
For those using Thymeleaf 3:
Home
If you have a context path on your application:
Edit:
To be concise:
The benefit to using request.getServletPath() is that it ignores the context path, if there is one.
request.getServletPath()