This week's book giveaway is in the Android forum.
We're giving away four copies of Android Programming: The Big Nerd Ranch Guide and have Bill Phillips & Chris Stewart on-line!
See this thread for details.
Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Security  RSS feed

 
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: 437
  • 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: 42972
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!