Following quiz provides Multiple Choice Questions (MCQs) related to JSP Fundamentals. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - response is instance of which class?
request is object of HttpServletResponse.
Q 2 - session is instance of which class?
request is object of HttpSession.
Q 3 - Which of the following attributes are mandatory in <jsp:useBean /> tag?
The useBean action first searches for an existing object utilizing the id and scope variables. If an object is not found, it then tries to create the specified object using class.
Q 4 - Which of the following attribute is used to have uncaught run-time exceptions automatically forwarded to an error processing page?
<%@ page errorPage="error.jsp" %>
It will redirect the browser to the JSP page error.jsp if an uncaught exception is encountered during request processing.
Q 5 - What is true about filters?
JSP Filters are Java classes that can be used in JSP Programming for both of the above purposes.
Q 6 - Which of the following is true about autoFlush Attribute?
The autoFlush attribute specifies whether buffered output should be flushed automatically when the buffer is filled, or whether an exception should be raised to indicate buffer overflow.
The default value (true) of isScriptingEnabled attribute enables scriptlets, expressions, and declarations.
Q 8 - Which of the following is true about <jsp:useBean> action?
useBean action first searches for an existing object utilizing the id and scope variables. If an object is not found, it then tries to create the specified object. useBean is used to load java beans in jsp page.
Q 9 - What is Localization?
Localization means adding resources to a web site to adapt it to a particular geographical or cultural region for example Hindi translation to a web site.
Q 10 - What is the use of <c:catch> tag?
The <c:catch> tag catches any Throwable that occurs in its body and optionally exposes it. Simply it is used for error handling and to deal more gracefully with the problem.