Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web-resource-collection ?

 
Aaron Raja
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider the web.xml snippet.

<web-app>
...
<security-constraint>
<web-resource-collection>
<web-resource-name>test</web-resource-name>
<url-pattern>/servlet/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>manager</role-name>
</auth-constraint>
</security-constraint>
...
</web-app>


In which of the following cases will the user be prompted for username/password?

[A] When the user clicks on a hyperlink displayed by Test


[B] the user clicks on the submit button of a form defined as: <form action="/servlet/TestServlet" method="POST">

[C] For both option 1 and option 2.

Which is true and why ?


Thanks
AR
 
Santhi Bharath
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[A] When the user clicks on a hyperlink displayed by Test


[B] the user clicks on the submit button of a form defined as: <form action="/servlet/TestServlet" method="POST">

[C] For both option 1 and option 2.

Which is true and why ?


Oprion 'B' is correct. Because it only causes to access the resource that is restricted
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic