Given this DD element:
(JSP v2.0 pg 1-87)
47. <jsp-property-group> 48. <url-pattern>*.jsp</url-pattern> 49. <el-ignored>true</el-ignored> 50. </jsp-property-group>
What does the element accomplish? (Choose all that apply.)
A. | All files with the specified extension mapping should be treated by the JSP container as well-formed XML files. | |
B. | All files with the specified extension mapping should have any Expression Language code evaluated by the JSP container. | |
C. | By default, all files with the specified extension mapping should NOT have any Expression Language code evaluated by the JSP container. | |
D. | Nothing, this tag is NOT understood by the container. | |
E. | Although this tag is legal, it is redundant, because the container behaves this way by default. |
Which directives specify an HTTP response that will be of type “image/svg”? (Choose all that apply.)
(JSP v2.0 section 1.10.1)
A. |
| |
B. |
| |
C. |
| |
D. |
| |
E. |
|
Given this JSP:
(JSP v2.0 section 1)
1. <%@ page import="java.util.*" %> 2. <html><body> The people who like 3. <%= request.getParameter("hobby") %> 4. are: <br> 5. <% ArrayList al = (ArrayList) request.getAttribute("names"); %> 6. <% Iterator it = al.iterator(); 7. while (it.hasNext()) { %> 8. <%= it.next() %> 9. <br> 10. <% } %> 11. </body></html>
Which types of code are used in this JSP? (Choose all that apply.)
Which statements about jspInit()
are true? (Choose all that apply.)
(JSP v2.0 section 11.2.1)
Which types of objects are available to the jspInit()
method? (Choose all that apply.)
(JSP v2.0 section 11.2.1)
A. |
| |
B. |
| |
C. |
| |
D. |
| |
E. |
| |
F. |
|
Given:
<%@ page isELIgnored="true" %>
What is the effect? (Choose all that apply.)
(JSP v2.0 pg 1-49)
A. | Nothing, this | |
B. | The directive turns off the evaluation of Expression Language code by the JSP container in all of the web application’s JSPs. | |
C. | The JSP containing this directive should be treated by the JSP container as a well-formed XML file. | |
D. | The JSP containing this directive should NOT have any Expression Language code evaluated by the JSP container. | |
E. | This page directive will only turn off EL evaluation if the DD declares a |
Which statement concerning JSPs is true? (Choose one.)
(JSP v2.0 section 11)
A. | Only | |
B. | Only | |
C. | Only _ | |
D. | Both | |
E. |
|
Which JSP lifecycle step is out of order?
(JSP v2.0 section 11)
A. | Translate the JSP into a servlet. | |
B. | Compile servlet source code. | |
C. |
| |
D. | Instantiate the servlet class. | |
E. |
| |
F. |
|
Which are valid JSP implicit variables? (Choose all that apply.)
(JSP v2.0 section 1.8.3)
Given a request with two parameters: one named “first” represents a user’s first name and another named “last” represents his last name.
Which JSP scriptlet code outputs these parameter values?
(JSP v2.0 pg 1-41)
A. | <% out.println(request.getParameter("first")); out.println(request.getParameter("last")); %> | |
B. | <% out.println(application.getInitParameter("first")); out.println(application.getInitParameter("last")); %> | |
C. | <% println(request.getParameter("first")); println(request.getParameter("last")); %> | |
D. | <% println(application.getInitParameter("first")); println(application.getInitParameter("last")); %> |
Given:
11. Hello ${user.name}! 12. Your number is <c:out value="${user.phone}"/>. 13. Your address is <jsp:getProperty name="user" property="addr" /> 14. <% if (user.isValid()) {%>You are valid!<% } %>
Which statements are true? (Choose all that apply.)
(JSP v2.0 pg. 1-10)
A. | Lines 11 and 12 (and no others) contain examples of EL elements. | |
B. | Line 14 is an example of scriptlet code. | |
C. | None of the lines in this example contain template text. | |
D. | Lines 12 and 13 include examples of JSP standard actions. | |
E. | Line 11 demonstrates an invalid use of EL. | |
F. | All four lines in this example would be valid in a JSP page. |
Which JSP expression tag will print the context initialization parameter named “javax.sql.DataSource”?
(JSP v2.0 pg 1-41)
A. |
| |
B. |
| |
C. |
| |
D. |
|
Which statements about disabling scripting elements are true? (Choose all that apply.)
(JSP v2.0 section 3.3.3)
A. | You can’t disable scripting via the DD. | |
B. | You can only disable scripting at the application level. | |
C. | You can disable scripting programmatically by using the | |
D. | You can disable scripting via the DD by using the |
In sequence, what are the Java types of the following JSP implicit objects: application
, out
, request
, response
, session
?
(JSP v2.0 pg 1-41)
A. | java.lang.Throwable java.lang.Object java.util.Map java.util.Set java.util.List | |
B. | javax.servlet.ServletConfig java.lang.Throwable java.lang.Object javax.servlet.jsp.PageContext java.util.Map | |
C. | javax.servlet.ServletContext javax.servlet.jsp.JspWriter javax.servlet.ServletRequest javax.servlet.ServletResponse javax.servlet.http.HttpSession | |
D. | javax.servlet.ServletContext java.io.PrintWriter javax.servlet.ServletConfig java.lang.Exception javax.servlet.RequestDispatcher |
Which is an example of the syntax used to import a class in a JSP?
(JSP v2.0 pg. 1-44)
A. |
| |
B. |
| |
C. |
| |
D. |
| |
E. |
|
Given the JSP:
1. <%@ page isELIgnored="true" %> 2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3. <c:set var="awesomeBand" value="LIMOZEEN"/> 4. ${awesomeBand}
What will be the output?
(JSP v2.0 section 1.10.1)
A. |
| |
B. |
| |
C. | No output | |
D. | An exception will be thrown because all |