Final Mock Test Question 49,69, Head First and Servlets
q-49
1. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/
jstl/core" %>
2. <%@ taglib prefix="tables" uri="http://www.javaranch.
com/tables" %>
3. <%@ taglib prefix="jsp" tagdir="/WEB-INF/tags" %>
4. <%@ taglib uri="UtilityFunctions" prefix="util" %>
What about the above taglib directives would cause the
JSP to not function?
A. Line 4 is wrong because the prefix attribute must come before the
uri attribute.
B. Line 3 is wrong because there is no uri attribute.
C. Line 4 is wrong because the uri value must begin with
http://
D. Line 3 is wrong because the prefix jsp is reserved for standard actions.
Correct answer is C
I think the correct answer is D
jsp is reserved .It can't be used
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
q-69
Your web application has a valid dd with a single <security-constraint> tag.
Within this tag exists:
- a single http method that declares GET
All of the resources in your application exist within directory1 and
directory2 and the only defined roles are BEGINNER and EXPERT.
If you want to restrict BEGINNERs from using resources in directory2, which
are true about the url and role tag(s)
you should declare? (Choose all that apply.)
A. A single url tag should declare directory1 and a single role tag should
declare EXPERT.
B. A single url tag should declare directory2 and a single role tag should
declare EXPERT.
C. A single url tag should declare directory1 and a single role tag should
declare BEGINNER.
D. A single url tag should declare directory2 and a single role tag should
declare BEGINNER.
E. One url tag should declare ANY and its role tag should declare EXPERT,
and another url tag should declare directory2 and its role tag should
declare BEGINNER.
F. One url tag should declare both directories, and its role tag should declare
EXPERT, and another url tag should declare directory1 and its role tag
should declare BEGINNER.
Correct answer is D
I think answer should be B
A single url tag should declare directory2 and a single role tag should
declare EXPERT.
This would restrict the BEGINNER to make GET request to directory2
while the D would allow BEGINNER to make GET request to directory2.