I´m new to Tomcat. I want to make a servlet to show a dynamic menú of options based on the roles of the authenticated user. To accomplish that, I have a table with 'option' and 'role' columns. I want to know how to programatically obtain the set of roles of the authenticated user, independent from the type of the security realm used.
I will appreciate any help.
1. use the HttpServletRequest to retrieve the user name
2. use the user name retrieve the user role from the realm (JNDI, JDBC etc).
Yes, I know how to get the user login name. Please tell me how to access the realm (in order to retrieve the user role) independently from the type of realm used.