Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

MARATHAWADA MITRAMANDAL’S POLYTECHNIC, THERGAON, PUNE-33

Academic Year 2019-2020

Program: CO5I Course: Advanced Java Programming (22517) Course Co-ordinator: Mrs.Chavan P.P.
Unit VI- Servlets
Question Bank

Sr.
Question Option A Option B Option C Option D
No.

The Java _________ specification defines an application


1 programming interface for communication between the web server servlet randomise applet script
and the application program

Which method is used to specify before any lines that uses the
2 setPageType() setContextType() setContentType() setResponseType()
PintWriter ?

3 What are the functions of Servlet container? Life cycle management Communication support Multithreading support All of the above

What type of servlets use these methods doGet(), doPost(), doHead,


4 Genereic Servlets HttpServlets All of the above None of these
doDelete(), doTrace() ?

5 Web server is used for loading the init() method of servlet. TRUE FALSE

6 Which packages represent classes for servlet API? javax.servlet javax.servlet.http Both a and b None of these

init, Service, destroy method


7 What is the lifecycle of a servlet ? Servlet class is loaded Servlet instance is created All of these
is invoked

servlets execute on servers 8servlets create static pages servlets can execute single
8 What is the difference between servlet and applet? while applets execute on while applets create dynamic request while applets execute None of these
browser pages multiple requests

web component response web component request


9 A deployment descriptor describes web component settings All of these
settings settings

Which object is created by the web container at time of deploying


10 ServletConfig ServletContext Both a and b None of the above
the project?
In HTIP Request method Get request is secured because data is
11 TRUE FALSE
exposed in URL bar
Which class can handle any type of request so that it is protocol-
12 GenericServlet HttpServlet Both a and b None of the above
independent ?

13 Servlet technology is used to create web application TRUE FALSE


The doGetO method extracts values of the parameter's types and
14 esponse.getAttribute() esponse.getParameter() request.getParameter() request.setParameter()
number by using __

Dynamic interception of requests and response to transform the


15 Servlet Filter Servlet Config Servlet Container Servlet Context
information is done by _

16 The life cycle of a servlet is managed by _ http and https servlet context servlet itself servlet container

17 Which method take a string not a URL ? sendRedirect forward Both none

18 Which method shows the client what server is receiving? doGet doOption doTrace doPost

URL rewriting, using session URL rewriting, using servlet URL rewriting, using session
19 Which of the following are session tracking techniques object, using cookies using object, using response object; object, using response
hidden fields using cookies object, using hidden field

Which methods are used to bind the objects on HttpSession


20 setAttribute getAttribute Both a and b none of these
instance and get the objects?
Sessions is a part of the SessionTracking and it is for maintaining the
21 TRUE FALSE
client state at server side.

Which cookie it is valid for single session only and it is removed each
22 Persistent cookie Non-persistent cookie All of these None of these
time when the user closes the browser?

Which method in session tracking is used in a bit of information that


23 is sent by a web server to a browser and which can later be read HttpSession URL rewriting Cookies Hidden form fields
back from that browser?

You might also like