Top 80+ Solved J2EE Technologies MCQ Questions Answer
Q. Which tag should be used to pass information from JSP to included JSP?
a. Using <%jsp:page> tag
b. Using <%jsp:param> tag
c. Using <%jsp:import> tag
d. Using <%jsp:useBean> tag
Q. Application is instance of which class?
a. javax.servlet.Application
b. javax.servlet.HttpContext
c. javax.servlet.Context
d. javax.servlet.ServletContext
Q. _jspService() method of HttpJspPage class should not be overridden.
a. True
b. False
c. none
d. all
Q. Which option is true about session scope?
a. Objects are accessible only from the page in which they are created
b. Objects are accessible only from the pages which are in same session
c. Objects are accessible only from the pages which are processing the same request
d. Objects are accessible only from the pages which reside in same application
Q. Which one is the correct order of phases in JSP life cycle?
a. Initialization, Cleanup, Compilation, Execution
b. Initialization, Compilation, Cleanup, Execution
c. Compilation, Initialization, Execution, Cleanup
d. Cleanup, Compilation, Initialization, Execution
Q. “request” is instance of which one of the following classes?
a. Request
b. HttpRequest
c. HttpServletRequest
d. ServletRequest
Q. Which one of the following is correct for directive in JSP?
a. <%@directive%>
b. <%!directive%>
c. <%directive%>
d. <%=directive%>
Q. Which of the following action variable is used to include a file in JSP?
a. jsp:setProperty
b. jsp:getProperty
c. jsp:include
d. jsp:plugin
Q. “out” is implicit object of which class?
a. javax.servlet.jsp.PrintWriter
b. javax.servlet.jsp.SessionWriter
c. javax.servlet.jsp.SessionPrinter
d. javax.servlet.jsp.JspWriter
Q. Which object stores references to the request and response objects?
a. sessionContext
b. pageContext
c. HttpSession
d. sessionAttribute
Q. What temporarily redirects response to the browser?
a. <jsp:forward>
b. <%@directive%>
c. response.sendRedirect(URL)
d. response.setRedirect(URL)