I am using Tomcat realm for security and my question is that I didn’t know where to get the user’s information after logging in.
I want to use the role of the user that has logged on and I don’t know what Tomcat sets in it’s session after logging on.
Tomcat follows the servlet specification and makes the user’s information available to your webapp in two ways:
Note that you can’t just get “the user’s role” because the user may have multiple roles. The standard API does not include a way to get all the user’s roles: you have to check for them individually.