Chapter 38 JavaServer Pages
Section 38.2 A Simple JSP Page
1. A JSP file ends with .
a. .java extension
b. .html extension
c. .shtml extension
d. .jsp extension
#
2. You can run JSP from .
a. any Web server
b. any JVM
c. any Web server that supports Java servlet and JSP
d. any Web browser
#
Section 38.3 How Is a JSP Page Processed?
3. Which of the following statements are true?
a. JSP is translated into Java servlet by a Web server when a JSP is called.
b. JSP is translated into HTML by a Web server when a JSP is called.
c. JSP is translated into XML by a Web server when a JSP is called.
d. You can embed Java code in JSP.
#
Section 38.4 JSP Scripting Constructs
4. is a JSP expression.
a. <%= i %>
b. <%= Math.pow(2, 3) %>
c. <%= new Date().toString() %>
d. <% for (int i = 0; i <= 10; i++) { %>
#
5. is a JSP scriptlet.
a. <%= i %>
b. <%= Math.pow(2, 3) %>
c. <%! private long computeFactorial(int n) { if (n == 0)return 1;else return n * computeFactorial(n – 1); } %>
d. <% for (int i = 0; i <= 10; i++) { %>
e. <!–– HTML Comment —%>
#
6. is a JSP declaration.
a. <%= i %>
b. <%= Math.pow(2, 3) %>
c. <%! private long computeFactorial(int n) { if (n == 0) return 1; else return n * computeFactorial(n – 1); } %>
d. <% for (int i = 0; i <= 10; i++) { %>