How to compare string with request parameter in html in Thymeleaf tag \"th:if\" ? right now i am using this
It's not working because param.error
is array of strings. You must retrieve first element of array (param.error[0]
) to get first value of parameter (see documentation). Besides that you can access request parameter via Web context object method #httpServletRequest.getParameter
that returns first value when parameter is multivalued (see documentation).
Usage of Web context namespaces for request attributes
Usage of Web context object