- 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 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()
Answer : A
Explaination
The isThreadSafe option marks a page as being thread-safe. By default, it is true and all JSPs are considered thread-safe.
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 - 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.
Answer : A
Explaination
The default value of the attribute is true, meaning that expressions, ${...}, are evaluated as dictated by the JSP specification. If the attribute is set to false, then expressions are not evaluated but rather treated as static text.
Answer : A
Explaination
The default value (true) of isScriptingEnabled attribute enables scriptlets, expressions, and declarations.
Q 8 - Which of the following is true about <jsp:setProperty> action?
A - The setProperty action sets the properties of a Bean.
B - The Bean must have been previously defined before using setProperty action.
Answer : C
Explaination
The setProperty action sets the properties of a Bean. The Bean must have been previously defined before this action.
Q 9 - Which of the following is true about locale?
Answer : C
Explaination
Locale is a particular cultural or geographical region. It is usually referred to as a language symbol followed by a country symbol which are separated by an underscore. For example "en_US" represents english locale for US.
Q 10 - Which of the following is true about <c:url> tag
A - The <c:url> tag formats a URL into a string and stores it into a variable.
B - The <c:url> tag automatically performs URL rewriting when necessary.
Answer : C
Explaination
The <c:url> tag formats a URL into a string and stores it into a variable. This tag automatically performs URL rewriting when necessary.
To Continue Learning Please Login
Login with Google