• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

doubt in security-constraint

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ohh ya ya .. you are right .. Thanks for correcting me..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic