- 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()
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 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 - What is true about filters?
Answer : C
Explaination
JSP Filters are Java classes that can be used in JSP Programming for both of the above purposes.
Q 6 - What happens when autoFlush is set to a value "false"?
A - JSP container throws exceptionto indicate buffer overflow when buffer is filled.
B - JSP container flushed the buffered output when buffer is filled.
Answer : A
Explaination
A value of true (default) indicates automatic buffer flushing and a value of false throws an exception.
Q 7 - Which of the following is true about info Attribute?
A - The info attribute lets you provide a description of the JSP.
B - The info attribute is used by JSP container for optimization of generated servlet code.
Answer : A
Explaination
The info attribute lets you provide a description of the JSP.
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 : 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: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