This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft 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 Java 8 in Action this week in the Java 8 forum!
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: 39578
    
  27
For the code, have a look at the methods HttpServletRequest.isUserInRole and HttpServletRequest.getRemoteUser.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Security
 
Similar Threads
Capturing user name entered as part of Basic authentication using Java code
securityManager in Netbeans?
java in xhtml
I'm not a hacker, but....
commonj.work timeout