Вы находитесь на странице: 1из 5

JSP MULTIPLE CHOICE QUESTIONS

1)
Which can generate HTML dynamically on the client but can hardly interact with the web server to
perform complex tasks like database access and image processing etc. in JSP?
a. vs.Static HTML
b. vs.Server-Side Includes
c. vs.Pure Servlets
d. Vs.JavaScript

2)
Which Error Handling in Java handles runtime errors with exceptions, If an exception is not caught
in your JSP or Servlet, Resin will use a special error page to send results back to the browser, Resin uses a
default error page unless you explicitly provide an error page yourself?
a. Client Request Time Processing Errors
b. Compilation Time Processing Errors
c. JSP Translation Time Processing Errors
d. None of the above

3)
Which attribute specifies a JSP page that should process any exceptions thrown but not caught in
the current page?
a. The ErrorPage Attribute
b. The IsErrorPage Attribute
c. Both A & B
d. None of the above

4)

What technique is used for the authentication mechanism in the servlet specification?
a. Role Based Authentication
b. Form Based Authentication

c. Both A & B
d. None of the above

5)

Which two interfaces does the javax.servlet.jsp package have?


a.

JspPage

b. HttpJspPage
c. JspWriter
d. PageContext
e. Both A & B

6)

Which of the following is an advantage of the statement Separation of business logic from JSP ?
a. Custom Tags in JSP
b. JSP Standard Tag Library
c. All the above
d. None of the above

7) Which of the following attribute is used to mark a page as error processing page?
a. A - isErrorPage
b. B - errorPage
c. C - exception
d. D - exceptionPage

8) Which of the following is true about session Attribute?


a. The session attribute indicates whether or not the JSP page uses HTTP sessions.
b. A value of true means that the JSP page has access to a builtin session object.
c. A value of false means that the JSP page cannot access the builtin session object.

d. All of the above.

9) 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.

10)
How many jsp implicit objects are there and these objects are created by the web container that
are available to all the jsp pages?
a. 8
b. 9
c. 10
d. 7

11)
A bean encapsulates many objects into one object, so we can access this object from multiple
places.
a. True
b. False

12)

Which tag is used to execute java source code in JSP?


a. Declaration Tag
b. Scriptlet tag
c. Expression tag
d. None of the above

13)

Which packages does a JSP API consist of?


a. javax.servlet.jsp
b. java.servlet
c. javax.servlet.jsp.tagext
d. Both A & C

14)What is the correct signature of jspDestroy() method of HttpJspPage class?


a. void jspDestroy(HTTPRequest request, HTTPResponse response)
b.

void jspDestroy(HTTPRequest request, HTTPResponse response) throws ServletException,


IOException

c.

void jspDestroy()

d.

void jspDestroy() throws ServletException, IOException

15)Which of the following is true about session 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.

c. Object created with request scope are accessible only from the pages which are processing the
same request.
d. Object created with request scope are accessible only from the pages which reside in same
application.

16)Which of the following method can be used to read a form parameter in JSP?
a. request.getParameter()
b. response.getParameter()
c. request.getValue()
d. response.getValue()

17)Which of the following is true about <c:param> tag?


a. The <c:param> tag allows proper URL request parameter to be specified with URL.
b. The <c:param> tag does any necessary URL encoding required
c. Both of the above.
d. None of the above.

18)out is instance of which class?


a. javax.servlet.jsp.JspWriter
b. javax.servlet.jsp.PringWriter
c. javax.servlet.Writer
d. javax.servlet.jsp.Writer

19) 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.

20) 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.
d. None of the above.

Вам также может понравиться