- 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 _jspService() method of HttpJspPage class?
A - void _jspService(HTTPRequest request, HTTPResponse response)
Answer : B
Explaination
Correct Signature is
void _jspService(HTTPRequest request, HTTPResponse response) throws ServletException, IOException
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 is true about request 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 : C
Explaination
Object created with request scope are accessible only from the pages which are processing the same request. Object data is available to another page in case of forward.
Answer : B
Explaination
isErrorPage is required to be set true, it is false by default.
Q 5 - out is instance of which class?
A - javax.servlet.jsp.JspWriter
Answer : A
Explaination
The out implicit object is an instance of a javax.servlet.jsp.JspWriter object and is used to send content in a response.
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 - What will happen if isELIgnored attribute is set as false?
A - Expression Language (EL) expressions will not be evaluated and will be treated as static text.
B - JSP container will ignore the EL expressions similar to comments.
Answer : A
Explaination
If the attribute is set to false, then expressions are not evaluated but rather treated as static text.
Q 8 - Which of the following is true about <jsp:getProperty> action?
Answer : C
Explaination
The getProperty action is used to retrieve the value of a given property and converts it to a string, and finally inserts it into the output.
Q 9 - What is Localization?
A - Localization refers to creating local content on a website.
B - Localization refers to adding locale related information to a website.
Answer : C
Explaination
Localization means adding resources to a web site to adapt it to a particular geographical or cultural region for example Hindi translation to a web site.
Q 10 - What's the difference between JavaBeans and taglib directives?
B - Custom tags are used to implement actions and JavaBeans are used to present information.
Answer : A
Explaination
JavaBeans and taglib fundamentals were introduced for reusability. But following are the major differences between them −
Taglibs are for generating presentation elements while JavaBeans are good for storing information and state.
Use custom tags to implement actions and JavaBeans to present information.
To Continue Learning Please Login
Login with Google