This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Security" Watch "Security" New topic
Author

Security

Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
Hi!

I was reading the chapter of Security, and i pretty much understood the theoritical part.
But i wasn't sure how to run a basic code to understand it practically.
Can some body help me what all fies are needed to run a basic security code.
I am stumbling through the last few chapters and not sure how to run it... So any help would be great !

Thanks!


The future belongs to those who believe in the beauty of their dreams.Dream BIG!
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Hi, Nabila.

If we are using Tomcat, first we need to define role's in tomcat-users.xml.

This is sample web.xml,
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42035
    
  64
For the code, have a look at the methods HttpServletRequest.isUserInRole and HttpServletRequest.getRemoteUser.


Ping & DNS - my free Android networking tools app
 
Consider Paul's rocket mass heater.
 
subject: Security