- 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.
Answer : A
Explaination
JSP container creates _jspService() methods so it should not be overridden.
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 is the methods of generated Servlet?
Answer : D
Explaination
All of the above methods get generated in generated servlet.
Q 4 - Which of the following is true about session 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 : B
Explaination
Object created with request scope are accessible only from the pages which are in same session. Object data is available till session is alive.
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 are cookies?
Answer : A
Explaination
Cookies are text files stored on the client computer and they are kept for various information tracking purpose.
Q 7 - What will happen if isScriptingEnabled attribute is set as false?
Answer : A
Explaination
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:useBean> action?
Answer : C
Explaination
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. useBean is used to load java beans in jsp page.
Answer : A
Explaination
Yes. JSP technology is extensible through the development of custom actions, or tags, which are encapsulated in tag libraries.
Q 10 - Which of the following is true about <c:choose> tag?
B - The <c:choose> tag has <c:when> tags.
Answer : D
Explaination
The <c:choose> works like a Java switch statement in that it lets you choose between a number of alternatives. Where the switch statement has case statements, the <c:choose> tag has <c:when> tags. A a switch statement has default clause to specify a default action and similar way <c:choose> has <otherwise> as default clause.