Deck 3: Servlets and Session Tracking
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/24
Play
Full screen (f)
Deck 3: Servlets and Session Tracking
1
Sessions is a part of the SessionTracking and it is for maintaining the client state at server side.
True
2
When destroy() method of a filter is called?
A)The destroy() method is called only once at the end of the life cycle of a filter
B)The destroy() method is called after the filter has executed doFilter method
C)The destroy() method is called only once at the begining of the life cycle of a filter
D)The destroyer() method is called after the filter has executed
A)The destroy() method is called only once at the end of the life cycle of a filter
B)The destroy() method is called after the filter has executed doFilter method
C)The destroy() method is called only once at the begining of the life cycle of a filter
D)The destroyer() method is called after the filter has executed
The destroy() method is called only once at the end of the life cycle of a filter
3
Web server is used for loading the init() method of servlet.
True
4
Servlets handle multiple simultaneous requests by using threads.
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
5
Which method is used to send the same request and response objects to another servlet in RequestDispacher ?
A)forward()
B)sendRedirect()
C)Both A & B
D)None of the above
A)forward()
B)sendRedirect()
C)Both A & B
D)None of the above
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
6
The sendRedirect() method of HttpServletResponse interface can be used to redirect response to another resource, it may be servlet, jsp or html file
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
7
Which packages represent interfaces and classes for servlet API?
A)javax.servlet
B)javax.servlet.http
C)Both A & B
D)None of the above
A)javax.servlet
B)javax.servlet.http
C)Both A & B
D)None of the above
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
8
Which class can handle any type of request so that it is protocol-independent?
A)GenericServlet
B)HttpServle
C)Both A & B
D)None of the above
A)GenericServlet
B)HttpServle
C)Both A & B
D)None of the above
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
9
Which HTTP Request method is non-idempotent?
A)GET
B)POST
C)Both A & B
D)None of the above
A)GET
B)POST
C)Both A & B
D)None of the above
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
10
Which object is created by the web container at time of deploying the project?
A)ServletConfig
B)ServletContext
C)Both A & B
D)None of the above
A)ServletConfig
B)ServletContext
C)Both A & B
D)None of the above
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
11
What is the lifecycle of a servlet?
A)Servlet class is loaded
B)Servlet instance is created
C)init,Service,destroy method is invoked
D)All mentioned above
A)Servlet class is loaded
B)Servlet instance is created
C)init,Service,destroy method is invoked
D)All mentioned above
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
12
Which method in session tracking is used in a bit of information that is sent by a web server to a browser and which can later be read back from that browser?
A)HttpSession
B)URL rewriting
C)Cookies
D)Hidden form fields
A)HttpSession
B)URL rewriting
C)Cookies
D)Hidden form fields
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
13
How many techniques are used in Session Tracking?
A)4
B)3
C)2
D)5
A)4
B)3
C)2
D)5
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
14
In HTTP Request method Get request is secured because data is exposed in URL bar
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
15
In the following statements identify the disadvantages of CGI?
A)If number of clients increases, it takes more time for sending response
B)For each request, it starts a process and Web server is limited to start processes
C)It uses platform dependent language e.g. C, C++, perl
D)All mentioned above
A)If number of clients increases, it takes more time for sending response
B)For each request, it starts a process and Web server is limited to start processes
C)It uses platform dependent language e.g. C, C++, perl
D)All mentioned above
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
16
Servlet technology is used to create web application
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
17
Which method is used to specify before any lines that uses the PintWriter?
A)setPageType()
B)setContextType()
C)setContentType()
D)setResponseType()
A)setPageType()
B)setContextType()
C)setContentType()
D)setResponseType()
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
18
What are functions of Servlet container?
A)Lifecycle management
B)Communication Support
C)Multithreading Support
D)All of the above
A)Lifecycle management
B)Communication Support
C)Multithreading Support
D)All of the above
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
19
Which object of HttpSession can be used to view and manipulate information about a session?
A)session identifier
B)creation time
C)last accessed time
D)All mentioned above
A)session identifier
B)creation time
C)last accessed time
D)All mentioned above
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
20
Which methods are used to bind the objects on HttpSession instance and get the objects?
A)setAttribute
B)getAttribute
C)Both A & B
D)None of the above
A)setAttribute
B)getAttribute
C)Both A & B
D)None of the above
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
21
Which method take a string not a URL?
A)sendRedirect
B)forward
C)Both
D)None
A)sendRedirect
B)forward
C)Both
D)None
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
22
Which of the following are interface?
1) ServletContext
2) Servlet
3) GenericServlet
4) HttpServlet
A)1,2,3,4
B)1,2
C)1,2,3
D)1,4
1) ServletContext
2) Servlet
3) GenericServlet
4) HttpServlet
A)1,2,3,4
B)1,2
C)1,2,3
D)1,4
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
23
The life cycle of a servlet is managed by
A)servlet context
B)servlet container
C)the supporting protocol (such as http or https)
D)All of the above
A)servlet context
B)servlet container
C)the supporting protocol (such as http or https)
D)All of the above
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
24
Which of the following code is used to get an attribute in a HTTP Session object in servlets?
A)session.getAttribute(String name)
B)session.alterAttribute(String name)
C)session.updateAttribute(String name)
D)session.setAttribute(String name)
A)session.getAttribute(String name)
B)session.alterAttribute(String name)
C)session.updateAttribute(String name)
D)session.setAttribute(String name)
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck