Professional Documents
Culture Documents
D - javax.servlet.Application
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 is default value of autoFlush Attribute?
A - true
B - false
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 isThreadSafe Attribute?
A - The isThreadSafe option marks a page as being thread-safe.
B - If you set the isThreadSafe option to false, the JSP engine makes sure that only
one thread at a time is executing your JSP.
C - By default, all JSPs are considered thread-safe.
D - All of the above.
Answer : D
Explaination
The isThreadSafe option marks a page as being thread-safe. By default, all JSPs
are considered thread-safe. If you set the isThreadSafe option to false, the JSP
engine makes sure that only one thread at a time is executing your JSP.
Q 8 - Which of the following is true about <jsp:forward> action?
A - The forward action terminates the action of the current page.
B - The forward action forwards the request to another resource such as a static
page, another JSP page, or a Java Servlet.
C - Both of the above.
D - None of the above.
Show Answer
Answer : C
Explaination
The forward action terminates the action of the current page and forwards the
request to another resource such as a static page, another JSP page, or a Java
Servlet.
Q 9 - What is Internationalization?
A - Internationalization means creating international content on a website.
B - Internationalization means enabling a web site to provide different versions of
content translated into the visitor's language or nationality.
C - Internationalization refers to creating local content on a website.
A - When a container loads a JSP it invokes the jspInit() method before servicing
any requests.
B - Container invokes _jspService() method during Initialization phase.
C - Both of the above.
D - None of the above.
Answer : A
Explaination
When a container loads a JSP it invokes the jspInit() method before servicing any
requests.
Q 9 - Is JSP technology extensible?
A - true
B - false
Show Answer
Answer : A
Explaination
Yes. JSP technology is extensible through the development of custom actions, or
tags, which are encapsulated in tag libraries.
Q 10 - What's the difference between JavaBeans and taglib directives?
A - Taglibs are for generating presentation elements while JavaBeans are good for
storing information and state.
B - Custom tags are used to implement actions and JavaBeans are used to present
information.
C - Both of the above.
D - None of the above.
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.
Q 1 - response is instance of which class?
A - Response
B - HttpResponse
C - HttpServletResponse
D - ServletResponse
Answer : C
Explaination
request is object of HttpServletResponse.
Answer : C
Explaination
You call request.getParameterNames() method to get the names of all the
parameters passed.
Q 6 - Which of the following is true about import Attribute?
A - The import attribute serves the same function as, and behaves like, the Java
import statement.
B - The value for the import option is the name of the package you want to import.
C - Both of the above.
D - None of the above.
Answer : C
Explaination
The import attribute serves the same function as, and behaves like, the Java import
statement. The value for the import option is the name of the package you want to
import.
Q 7 - What is the default value of isScriptingEnabled attribute?
A - true
B - false
Answer : A
Explaination
The default value (true) of isScriptingEnabled attribute enables scriptlets,
expressions, and declarations.
Q 8 - Is it possible to include files using absolute path in a JSP page using include
directive?
A - true
B - false
Answer : A
Explaination
No! include directive takes relative URL with respect to current domain of web
application.
Q 9 - Which of the following is true about locale?
A - This is a particular cultural or geographical region.
B - Locale is usually referred to as a language symbol followed by a country
symbol which are separated by an underscore.
C - Both of the above.
D - None of the above
Answer : C
Explaination
A - Cookies are text files stored on the client computer and they are kept for
various information tracking purpose.
B - Cookies are binary files stored on the server computer and they are kept for
various information tracking purpose.
C - Cookies are binary files stored on the client computer and they are kept for data
storage purpose.
D - None of the above.
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?
A - A translation-time error will be raised if the JSP uses any scriptlets, expressions
(non-EL), or declarations.
B - JSP container will ignore the any scriptlets, expressions (non-EL), or
declarations similar to comments.
C - Both of the above.
D - None of the above.
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 Cleanup phase in JSP life cycle?
A - The destruction phase of the JSP life cycle represents when a JSP is being
removed from use by a container.
B - The jspDestroy() method is the JSP equivalent of the destroy method for
servlets.
C - Both of the above.
D - None of the above.
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.
Q 9 - Is JSP technology extensible?
A - true
B - false
Answer : A
Explaination
Yes. JSP technology is extensible through the development of custom actions, or
tags, which are encapsulated in tag libraries.
Q 10 - What is the use of <c:catch> tag?
A - to catch any Throwable that occurs in its body and optionally exposes it.
B - to catch the runtime error and redirect to error page.
C - Both of the above.
D - None of the above.
Show Answer
Answer : A
Explaination
The <c:catch> tag catches any Throwable that occurs in its body and optionally
exposes it. Simply it is used for error handling and to deal more gracefully with the
problem.
Q 1 - Which of the following is not a implicit object?
A - request
B - response
C - cookie
D - session
Show Answer
Answer : C
Explaination
There is no cookie object in jsp.
Q 2 - if isThreadSafe attribute of page directive is set as true, then generated
servlet implements SingleThreadModel interface.
A - True
B - False
Show Answer
Answer : B
Explaination
If isThreadSafe attribute of page directive is set as false, then generated servlet
implements SingleThreadModel interface.
Q 3 - Which is the methods of generated Servlet?
A - jspInit()
B - _jspService()
C - jspDestroy()
D - All of the above
Answer : D
Explaination
All of the above methods get generated in generated servlet.
QQ 5 - What is true about filters?
A - JSP Filters are used to intercept requests from a client before they access a
resource at back end.
B - JSP Filters are used to manipulate responses from server before they are sent
back to the client.
C - Both of the above.
Explaination
The compilation process involves three steps: a) Parsing the JSP, b) Turning the
JSP into a servlet, c) Compiling the servlet.
Q 9 - Can you make use of a ServletOutputStream object from within a JSP page?
A - true
B - false
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 - What's the difference between JavaBeans and taglib directives?
A - Taglibs are for generating presentation elements while JavaBeans are good for
storing information and state.
B - Custom tags are used to implement actions and JavaBeans are used to present
information.
C - Both of the above.
D - None of the above.
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.