Download as xls, pdf, or txt
Download as xls, pdf, or txt
You are on page 1of 6

Question Opt-1 Opt-2

Which of the following code is used to get an attribute in a A. session.getAttribute(String


B. session.alterAttribute(String
name) name)
HTTP Session object in servlets?

What is the difference between servlets and applets? i.


Servlets execute on Server; Applets execute on browser
ii. Servlets have no GUI; Applet has GUI iii. Servlets
creates static web pages; Applets creates dynamic web
pages iv. Servlets can handle only a single request;
Applet can handle multiple requests a) i, ii, iii are correct b) i, ii are correct

b) Constructor
How constructor can be used for a servlet? a) Initialization function
a) b)
Which of the following code is used to get an attribute in session.getAttribute( session.alterAttribut
a HTTP Session object in servlets? String name) e(String name)

b) Servlets are
platform-
a) Servlets execute independent because
within the address they are written in
Which of the following is true about servlets? space of web server java
Can servlet class declare constructor with ServletConfig object 1 0
Which method is used to get three-letter abbreviation for Request.getISO3Count Locale.getISO3Countr
locale’s country in servlets? ry() y()

Servlets execute Servlets are platform-


Which of the following is true about servlets? within the address independent because
space of web server they are written in java

Which method in session tracking is used in a bit of


information that is sent by a web server to a browser and a. HttpSession b. URL rewriting
which can later be read back from that browser?
How is the dynamic interception of requests and responsesa) servlet container b) servlet config

The destroy() method The destroy() method


is called only once at is called after the filter
the end of the life has executed doFilter
cycle of a filter method
When destroy() method of a filter is called?
Which object of HttpSession can be used to view and
a. session identifier b. creation time
manipulate information about a session?
Which class provides stream to read binary data such
a. ServltInputStream b. ServletOutputStream
as image etc. from the request object?
Which of these ways used to communicate from an applet
a. RMI Communication b. HTTP Communication
Which methods are used to bind the objects on
a. setAttribute b. getAttribute
HttpSession instance and get the objects?
Which method is used to send the same request and
response objects to another servlet in a. forward() b. sendRedirect()
RequestDispacher ?
Which packages represent interfaces and classes for ser a. javax.servlet b. javax.servlet.http
Which HTTP Request method is non-idempotent? a. GET b. POST
Which object is created by the web container at time of de a. ServletConfig b. ServletContext
What is the lifecycle of a servlet? a. Servlet class is loaded
b. Servlet instance is created
Opt-3 Opt-4 Opt-5 Complexity CO-Level Blooms-Level

C. session.updateAttribute(String
D. session.setAttribute(String
name) name)
1 CO-4 1

d) i, ii, iii, iv are


c) i, iii are correct correct 2 CO-4 3

c) Initialization and
Constructor function d) Setup() method 1 CO-4 1
c) d)
session.updateAttrib session.setAttribute(
ute(String name) String name) 1 CO-4 2

d) Servlets execute
within the address
space of web server,
platform
c) Servlets can use independent and
the full functionality uses the
of the Java class functionality of java
libraries class libraries 2 CO-4 2
May be Can't say 2 CO-4 1
Response.getISO3Cou Local.retrieveISO3Co
ntry() untry() 3 CO-4 2

Servlets execute
within the address
Servlets can use the space of web server,
full functionality of platform independent
the Java class libraries and uses the
functionality of java
class libraries
1 CO-4 3

c. Cookies d. Hidden form fields


2 CO-4 3
c) servlet context d) servlet filter 2 CO-4 2

The destroy() method


The destroyer()
is called only once at
method is called after
the begining of the life
the filter has executed
cycle of a filter
1 CO-4 2

c. last accessed time


d. All mentioned above 1 CO-4 3
c. Both A & B d. None of the above
3 CO-4 2
c. Socket Communication
d. All mentioned above 1 CO-4 1

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


2 CO-4 2

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


2 CO-4 2
c. Both A & B d. None of the above 3 CO-4 1
c. BOTH A & B d. None of the above 2 CO-4 1
c. Both A & B d. None of the above 2 CO-4 3
c. init,Service,destroy d. All
method mentioned
is invoked
above 1 CO-4 2
Answer

4
2

3
4

4
1
4

1
3
2
2
4

You might also like