I am making a JSP/Servlet CRUD with MySQL. I currently have 2 roles in my project: manager and employee. I want to display different data based on these roles. How do I access the request.isUserInRole()
method without using scriptlets? I heard that using scriptlets are bad.
I temporarily have the following code:
<c:if <%request.isUserInRole("manager");%>=true>
<!-- Display something -->
<c:if <%request.isUserInRole("employee");%>=true>
<!-- Display something -->
But I get an error:
HTTP Status 500 - /protected/listUser.jsp (line: 97, column: 9) Unterminated <c:if tag
Which is probably some problem with JSTL mixing in with a scriptlet.
How would I access the isUserInRole()
method in my JSP page with only JSTL?