![JSP Tutorial](/jsp/images/jsp-mini-logo.jpg)
- 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.
![Questions and Answers](/images/questions_and_answers.png)
Answer : A
Explaination
JSP container creates _jspService() methods so it should not be overridden.
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.
Q 3 - Which of the following attributes are mandatory in <jsp:useBean /> tag?
Answer : B
Explaination
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 is an implicit object?
Answer : A
Explaination
pageContext is an implicit object.
Q 5 - Where filters are defined?
A - Filters are defined in the deployment descriptor file web.xml.
Answer : A
Explaination
Filters are defined in the deployment descriptor file web.xml and then mapped to either servlet or JSP names or URL patterns in your application's deployment descriptor.
Q 6 - Which of the following is true about extends Attribute?
A - The extends attribute can be used to define a subclass of generated servlet.
B - The extends attribute is used to specify a superclass that the generated servlet must extend.
Answer : B
Explaination
The extends attribute specifies a superclass that the generated servlet must extend.
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 - Is it possible to include files using absolute path in a JSP page using include directive?
Answer : A
Explaination
No! include directive takes relative URL with respect to current domain of web application.
Answer : A
Explaination
Yes. JSP technology is extensible through the development of custom actions, or tags, which are encapsulated in tag libraries.
Q 10 - What is the use of <c:remove > tag?
A - It removes a item from a list
Answer : C
Explaination
The <c:remove > tag removes a variable from either a specified scope or the first scope where the variable is found (if no scope is specified).