File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes [jdiscuss][mock][question] Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "[jdiscuss][mock][question]" Watch "[jdiscuss][mock][question]" New topic
Author

[jdiscuss][mock][question]

S.L.Narayanan
Ranch Hand

Joined: Apr 01, 2005
Posts: 431
Hi friends
I got a question as follows:



My answer was B. But the answer given was A. How it is possible?. As far as I know if we use the name given in <role-link> directly in the isUserInRole() method then it should directly map to the role. Am I right?


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, NEXT--->IBM XML
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

<security-role-ref>
<role-name>manager</role-name>
<role-link>supervisor</role-link>
</security-role-ref>


<security-role-ref> element, combined with <security> element can link a security role name used in a servlet as the argument to HttpServletRequest.isUserInRole() method to a role name known by the web container. All role names definded by <security-role> elements must be mapped to users and/or groups known by the web container. How this is done is container dependent. The <security-role-element> allows you to use servlet that uses a role name in the isUserRole() method that is not defined by a <security-role> elemnt. A typical scenario where this can be useful is whem you combine servlets from different sources into one application, and the servlets use different role names for tyhe same logical role.

So I think the given answer is correct.

Thanks


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: [jdiscuss][mock][question]
 
Similar Threads
role-link
Doubt regarding request.isUserInRole()
Practice exam question
role-link and role-name elements?
doubt in security role ref