This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Security Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Security " Watch "Security " New topic
Author

Security

Saurabh Naik
Ranch Hand

Joined: Apr 24, 2008
Posts: 87
Hello
I read the chapter security from HF book. but I am cofunsed..
If in my application there are 50 users and 3 roles i.e admin, user , guest . how can I assign these roles to my users ?
also confused in getUserInRole() and getUserPrinicpal() methods. what is the exact use of these methods ?

Thank you


SCJP 6 (88%), SCWCD 5 (78%), preparing for SCBCD
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41124
    
  45
See http://www.coderanch.com/t/444353/Web-Component-Certification-SCWCD/certification/User-Role-config-server

Those methods tell you the identty of the user who sent the request the servlet is currently working on (her user name), and which roles she has. This information can be used to personalize the response, and to check whether this user should be allowed access to the various parts/pages of the web app.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Security
 
Similar Threads
Creating users programatically
How to assign users to security roles?
implement security constraints and assign users
Declarative security : mapping user to security roles
Restricting Http methods thru tomcat configurations