Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
Servlets
« Previous
Next »
A servlet maintain session in
Options
- Servlet container
- Servlet context
- Servlet request heap
- Servlet response heap
CORRECT ANSWER : Servlet context
Discussion Board
Session management
Servlet session is maintained in servlet context and it is being provided by HTTP. HTTP is a stateless protocol that is each time a client retrieves a Web page, the client opens a separate connection to the Web server the server never keep any record of previous client request.
There are three ways to maintain a session between web client and web server:
1) Cookies are good way to maintain session as the webserver can assign unique session ID as cookie to each client and receives the replies from the client that can be stored as the received cookie.
2) Hidden Form Fields- this is another way to maintain session it can be done using a web server having a hidden HTML form field along with a unique session ID as follows:
<input type="hidden" name="sessionid" value="12345">
when the form is submitted, the specified name and value are automatically included in the GET or POST data.
3) URL Rewriting- this happens when some extra data is appended at the end of each URL that identifies the session, and the server can associate that session identifier with data it has stored about that session.
Rohit Sharma 11-29-2014 10:23 AM
« Previous
Next »
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
Java Beginner (11)
Java (39)
Java (40)
Java (22)
Java (30)
Java (25)
Java (20)
Java (20)
Core Java (20)
Core Java (10)
Core Java (72)
EJB (20)
JDBC (20)
Applet (20)
Struts (21)
Servlets (20)
Java Web Services (20)
Javascript (40)
J2EE (10)
jQuery (46)
Advertisement
▲