- 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
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 isThreadSafe attribute of page directive is set as true, then generated servlet implements SingleThreadModel interface.
Answer : B
Explaination
If isThreadSafe attribute of page directive is set as false, then generated servlet implements SingleThreadModel interface.
Answer : A
Explaination
Yes, all servlets are required to be mapped/configured in web.xml
Q 4 - Which of the following is true about page scope?
A - Object created with request scope are accessible only from the page in which they are created.
B - Object created with request scope are accessible only from the pages which are in same session.
Answer : A
Explaination
Object created with request scope are accessible only from the page which they are created. Object data gets lost once response is returned or request is forwarded.
Q 5 - out is instance of which class?
A - javax.servlet.jsp.JspWriter
Answer : A
Explaination
The out implicit object is an instance of a javax.servlet.jsp.JspWriter object and is used to send content in a response.
Q 6 - Which of the following is true about autoFlush Attribute?
Answer : C
Explaination
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.
Q 7 - Which of the following is true about include directive?
A - The include directive is used to include a file during the translation phase.
Answer : C
Explaination
The include directive is used to includes a file during the translation phase. This directive tells the container to merge the content of other external files with the current JSP during the translation phase.
Q 8 - Which of the following is true about <jsp:getProperty> action?
Answer : C
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 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 - What is the use of <c:catch> tag?
A - to catch any Throwable that occurs in its body and optionally exposes it.
Answer : A
Explaination
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.