- 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 jspInit() method of HttpJspPage class?
A - void jspInit(HTTPRequest request, HTTPResponse response)
B - void jspInit(HTTPRequest request, HTTPResponse response) throws ServletException, IOException
Answer : C
Explaination
Correct Signature is void jspInit()
Q 2 - If a jsp is to generate a pdf page, what attribute of page directive it should use?
Answer : A
Explaination
<%page contentType="application/pdf">
Above tag is used to generate PDF using JSP.
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.
Answer : C
Explaination
scriptlet is not a jsp directive.
Q 5 - application is instance of which class?
Answer : A
Explaination
The application object is direct wrapper around the ServletContext object for the generated Servlet and in reality an instance of a javax.servlet.ServletContext object.
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 isScriptingEnabled Attribute?
A - The isScriptingEnabled attribute determines if scripting elements are allowed for use.
B - The default value (true) enables scriptlets, expressions, and declarations.
Answer : C
Explaination
The isScriptingEnabled attribute determines if scripting elements are allowed for use. The default value (true) enables scriptlets, expressions, and declarations. If the attribute's value is set to false, a translation-time error will be raised if the JSP uses any scriptlets, expressions (non-EL), or declarations.
Q 8 - Which of the following is true about <jsp:forward> action?
A - The forward action terminates the action of the current page.
Answer : C
Explaination
The forward action terminates the action of the current page and forwards the request to another resource such as a static page, another JSP page, or a Java Servlet.
Q 9 - What JSTL stands for?
Answer : A
Explaination
JSTL, JavaServer Pages Standard Tag Library is a collection of useful JSP tags which encapsulates core functionality common to many JSP applications.
Q 10 - What is the use of <c:if> tag?
A - It is used to check if jsp tag library is enabled or not.
Answer : B
Explaination
The <c:if> tag evaluates an expression and displays its body content only if the expression evaluates to true.