• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web.xml

 
rex tony
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In web.xml where we have<auth-constraint>,<security-constraint> at el.What are the difference between these two?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A reasonably detailed explanation of all web.xml elements can be found here (and a more detailed one in the servlet specification).

In short, auth-constraint determines which role a user must be in in order to be allowed to access a particular URL (or set of URLs), while a security-constraint (which is the parent of auth-constraint) also encompasses information about which URLs those are in particular.
 
rex tony
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ulf Dittmer:
I already saw that url,but i couldn't understand.Can you explain with examples?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you read the relevant sections of the servlet specification as well? Tell us what you did understand from it, and what you're still unclear about. You'll learn more by explicitly writing that down than just reading what someone else has to say on the topic.

To give you a start for your own experiments, if you want to set up authentication in a web app of yours you'll need to have the following in your web.xml:
  • 1 login-config element
  • 1 or more security-role elements
  • 1 or more security-constraint elements

  •  
    rex tony
    Ranch Hand
    Posts: 159
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    DearUlf Dittmer,
    Thank you,From you i got some information.What is the purpose for tag<security-role-ref>
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic