How to get user agent from a thymeleaf html page -
in application using spring + thymeleaf. want user agent including cetain files.
<% string browser = request.getheader("user-agent") %>
i need done in thymeleaf page.how can that. appreciated
you can access httpservletrequest object #httpservletrequest
so, example, can print user agent
<span th:text="${#httpservletrequest.getrequest('user-agent')}">mozilla/5.0 (compatible; msie 10.0; windows nt 6.1; trident/5.0)</span
Comments
Post a Comment