| Author |
How to use Request.isUserInRole method?
|
Dave Bosky
Ranch Hand
Joined: Dec 16, 2003
Posts: 72
|
|
I want to use the standard J2EE construct HttpRequest.isUserInRole() in my web application. I understand how to check if the user is in a particular role by using if (request.isUserInRole(roleType)) {....do this....}. How do I assign the roles to the user when they login so I can use the method above? I'm using Tomcat5 and W2K. Thanks, Dave
|
 |
Nathaniel Stoddard
Ranch Hand
Joined: May 29, 2003
Posts: 1258
|
|
You should consult the Tomcat documentation for how to do this. Basically, you'll need to create a protected resource collection in your deployment descriptors, create roles in your deployment descriptors, create some database or other data store whose data will be consulted when a user logs into the protected area of your web application, and that's it. What roles belong to an individual when they authenticate themselves to the application is specified in the database, or however you set it up in Tomcat. Check out the docs. It's pretty simple.
|
Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56216
|
|
|
Moving to the Tomcat forum.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: How to use Request.isUserInRole method?
|
|
|