This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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 ?
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.