Given this DD element:
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.)
Given this JSP:
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.)
Which types of objects are available to the jspInit()
method? (Choose all that apply.)
Given:
<%@ page isELIgnored="true" %>
What is the effect? (Choose all that apply.)
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.)
Which JSP lifecycle step is out of order?
Which are valid JSP implicit variables? (Choose all that apply.)
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?
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.)
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”?
Which statements about disabling scripting elements are true? (Choose all that apply.)
In sequence, what are the Java types of the following JSP implicit objects: application
, out
, request
, response
, session
?
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?
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?