• Post Reply Bookmark Topic Watch Topic
  • New Topic

doubt in security-constraint

 
mimi chatterjee
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suppose in my application I want to make servlet1 is authorized for admin and servlet2 is authorized for guest....Can I write two <security-constraint> in a web.xml
 
Sarat Koduri
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi mimi..

the web.xml can contain only one element, but inside that element we can different <web-resource-collection> elements.. in your case we can have two web resource elements to secure two different resources..so called servlets.

Hope you got it...

[ September 22, 2008: Message edited by: Sarat Koduri ]
 
raja ram
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can do it using the <auth-constraint> tag of <security-constrained> there different meaning for different useage of <auth-constraint> tag see HFSJ book for this.

It can contain more than one <security-constraint> tag

Thanks
[ September 22, 2008: Message edited by: raja ram ]
 
mimi chatterjee
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ Sarat,
Yes I can put two <web-resource-collection>..but in that case how can I map the different <auth-constraint> with the diffrent <web-resource collection>, because in a <security-constraint> one <auth-constraint> is applicable for all <web-resource-collection>....
 
Sarat Koduri
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ohh ya ya .. you are right .. Thanks for correcting me..
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!