- Basic JSP Tutorial
- 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
- Advanced JSP Tutorials
- 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 - If a jsp is to generate a xml page, what attribute of page directive it should use?
Answer : D
Explaination
<%page contentType="text/xml">
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 true about language attribute?
A - The language attribute indicates the programming language used in scripting the servlet.
B - The language attribute indicates the programming language used in scripting the html page.
C - The language attribute indicates the programming language used in scripting the JSP page.
Answer : C
Explaination
The language attribute indicates the programming language used in scripting the JSP page.
Q 5 - pageContext is instance of which class?
A - javax.servlet.ServletContext
B - javax.servlet.ServletConfig
Answer : C
Explaination
The pageContext object is an instance of a javax.servlet.jsp.PageContext object. The pageContext object is used to represent the entire JSP page.
Q 6 - What happens when autoFlush is set to a value "false"?
A - JSP container throws exceptionto indicate buffer overflow when buffer is filled.
B - JSP container flushed the buffered output when buffer is filled.
Answer : A
Explaination
A value of true (default) indicates automatic buffer flushing and a value of false throws an exception.
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 - How to pass information from JSP to included JSP?
Answer : A
Explaination
Using <%jsp:param> tag you can pass information from JSP to included JSP.
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.
To Continue Learning Please Login
Login with Google