JSP Quiz - MCQ - Multiple Choice Questions
Q. What is the root object in JSP that provides access to the implicit objects and exposes JSP configuration information?
A. JspContextB. JspPage
C. JspWriter
D. PageContext
Q. Which tag is used to include static or dynamic resources in a JSP page?
A. <jsp:include>B. <jsp:forward>
C. <jsp:param>
D. <jsp:useBean>
Q. What is the purpose of the <jsp:useBean> tag in JSP?
A. To create a new instance of a JavaBeanB. To store data in the application scope
C. To forward the request to another JSP page
D. To include a static file in the JSP page
Q. Which scope is available to all JSP pages within the same web application?
A. Page scopeB. Request scope
C. Session scope
D. Application scope
Q. What is the purpose of the <jsp:setProperty> action in JSP?
A. To set the properties of a JavaBeanB. To get the properties of a JavaBean
C. To create a new JavaBean
D. To forward the request to another JSP
Q. Which JSP directive is used to specify the character encoding for the JSP page?
A. <%@ page language="java" contentType="text/html; charset=UTF-8" %>B. <%@ page language="java" pageEncoding="UTF-8" %>
C. <%@ page language="java" import="java.io.*" %>
D. <%@ page language="java" session="true" %>
Q. What is the purpose of the <jsp:forward> action in JSP?
A. To include a static file in the responseB. To redirect the request to another JSP page
C. To set the properties of a JavaBean
D. To create a new instance of a JavaBean
Q. How can you access the current HTTP request object in a JSP page?
A. request.getRequest()B. pageContext.getRequest()
C. application.getRequest()
D. session.getRequest()
Q. What is the purpose of the <jsp:param> action in JSP?
A. To set a parameter for a forwarded requestB. To get a parameter from a forwarded request
C. To set a session attribute
D. To get a session attribute