- 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.
Answer : A
Explaination
Yes, jspDestroy() method can be overridden.
Q 2 - Which of the following is not a valid attribute of a page directives?
Answer : C
Explaination
export is not a valid attribute of a page directive.
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.
Answer : B
Explaination
isErrorPage is required to be set true, it is false by default.
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 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 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 Cleanup phase in JSP life cycle?
B - The jspDestroy() method is the JSP equivalent of the destroy method for servlets.
Answer : C
Explaination
The destruction phase of the JSP life cycle represents when a JSP is being removed from use by a container.The jspDestroy() method is the JSP equivalent of the destroy method for servlets.
Answer : B
Explaination
No. You are supposed to make use of only a JSPWriter object (given to you in the form of the implicit object out) for replying to clients.
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.
To Continue Learning Please Login
Login with Google