This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes <security-constraint> doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "<security-constraint> doubt" Watch "<security-constraint> doubt" New topic
Author

<security-constraint> doubt

Parth Twari
Ranch Hand

Joined: Jan 20, 2010
Posts: 163
Source : Marcus

Which statements are true of the following snippet of a deployment descriptor.



A. It is faulty becasue it has multiple security-constraint elements Incorrect
B. It is faulty because it does not supply the http-method tag Incorrect
C. Only members of the manager role will be able to access the resource Incorrect
D. Any user will be able to access the resource Correct
E. No users will be able to access the resource

Answer: D

I think it shall be E , I tested it and it was coming as E only. Can anyone explain?


Parth Tiwari
| Pursuing Bachelor of Engineering | OSUM Club Leader | SCJP 6 | SCWCD 5 |...
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1628
    
  23

Hi Parth,

You are correct: when more than one constraint is set for the same resource: the no-value authority is overriding.

Regards,
Frits
Parth Twari
Ranch Hand

Joined: Jan 20, 2010
Posts: 163
ok..

Don't you think there shall be an error as well because of wrong placement of
<role-name>manager</role-name>

<auth-constraint>
</auth-constraint>
<role-name>manager</role-name>
</security-constraint>


and because

<web-resource-name>Sensitive</web-resource-name>


is same in both the constraints?
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1628
    
  23

Don't you think there shall be an error as well because of wrong placement of
<role-name>manager</role-name>

Yes, that won't work.....
<web-resource-name> is same in both the constraints?

This might work.... but it should not have the same name, you are right

Regards,
Frits
 
 
subject: <security-constraint> doubt
 
Similar Threads
Mock question about <auth-constraint>
security-constraint issue?
related to auth constraint
Marcus Green exam: Dueling auth-constraint elements
Marcus Green Quiz 1 - Mock Exam Question Doubt