- JSP - Home
- JSP - Overview
- JSP - Environment Setup
- JSP - Architecture
- JSP - Lifecycle
- JSP - Syntax
- JSP - Directives
- JSP - Actions
- JSP - Implicit Objects
- JSP - Client Request
- JSP - Server Response
- JSP - Http Status Codes
- JSP - Form Processing
- JSP - Writing Filters
- JSP - Cookies Handling
- JSP - Session Tracking
- JSP - File Uploading
- JSP - Handling Date
- JSP - Page Redirect
- JSP - Hits Counter
- JSP - Auto Refresh
- JSP - Sending Email
- JSP - Standard Tag Library
- JSP - Database Access
- JSP - XML Data
- JSP - Java Beans
- JSP - Custom Tags
- JSP - Expression Language
- JSP - Exception Handling
- JSP - Debugging
- JSP - Security
- JSP - Internationalization
- JSP Useful Resources
- JSP - Questions and Answers
- JSP - Quick Guide
- JSP - Useful Resources
- JSP - Discussion
JSP Online Quiz
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 - What is the correct signature of jspDestroy() method of HttpJspPage class?
A - void jspDestroy(HTTPRequest request, HTTPResponse response)
B - void jspDestroy(HTTPRequest request, HTTPResponse response) throws ServletException, IOException
Answer : C
Explaination
Correct Signature is
void jspDestroy()
Q 2 - session is instance of which class?
Answer : B
Explaination
request is object of HttpSession.
Q 3 - Which of the following attributes are mandatory in <jsp:getProperty /> tag?
Answer : A
Explaination
The getProperty action is used to retrieve the value of a given property and converts it to a string, and finally inserts it into the output.
Q 4 - Which of the following is an implicit object?
Answer : A
Explaination
pageContext is an implicit object.
Q 5 - Which of the following method can be used to read binary data stream coming from the client?
Answer : A
Explaination
You call request.getInputStream() method to read binary data stream coming from the client for example, image file uploaded.
Q 6 - Which of the following is true about isELIgnored Attribute?
A - The isELIgnored option gives you the ability to disable the evaluation of scriplets.
B - The isELIgnored option gives you the ability to disable the evaluation of java code in jsp.
Answer : C
Explaination
The isELIgnored option gives you the ability to disable the evaluation of Expression Language (EL) expressions. The default value of the attribute is true, meaning that expressions, ${...}, are evaluated as dictated by the JSP specification. If the attribute is set to false, then expressions are not evaluated but rather treated as static text.
Q 7 - Which of the following is true about session Attribute?
A - The session attribute indicates whether or not the JSP page uses HTTP sessions.
B - A value of true means that the JSP page has access to a builtin session object.
C - A value of false means that the JSP page cannot access the builtin session object.
Answer : D
Explaination
The session attribute indicates whether or not the JSP page uses HTTP sessions. A value of true means that the JSP page has access to a builtin session object and a value of false means that the JSP page cannot access the builtin session object.
Q 8 - Which of the following depicts correct order of phases in JSP life cycle?
A - Compilation, Initialization, Execution, Cleanup
B - Initialization, Compilation, Cleanup, Execution
Answer : A
Explaination
Compilation, Initialization, Execution, Cleanup is the correct order.
Q 9 - Which of the following is true about response.sendRedirect(url)?
A - The sendRedirect sends HTTP temporary redirect response to the browser.
Answer : C
Explaination
sendRedirect sends HTTP temporary redirect response to the browser, and browser creates a new request to go the redirected page.
Q 10 - Which of the following is true about <c:forEach > tag?
B - The <c:forEach > is used to iterate over a list of items in jsp.
Answer : C
Explaination
The <c:forEach > tag exists as a good alternative to embedding a Java for, while, or do-while loop via a scriptlet.