• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Security

 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the code, have a look at the methods HttpServletRequest.isUserInRole and HttpServletRequest.getRemoteUser.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic