File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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


Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661

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 !


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

Joined: Mar 22, 2005
Posts: 42965
For the code, have a look at the methods HttpServletRequest.isUserInRole and HttpServletRequest.getRemoteUser.
I agree. Here's the link:
subject: Security
jQuery in Action, 3rd edition