Why http is a stateless protocol ?, JAVA Programming

 

The "http protocol" is a stateless response or request based protocol.

You may contain the state information between different page requests as given below:

HTTP Sessions are the recommended useful approach. A session finds the requests that originate from the same browser in the mean while the period of conversation. All the servlets may share the similar session. The JSESSIONID is started by the server and may be passed to client through URL re-writing (if cookies are turned off), cookies or built-in SSL process.   Care could be given to minimize size of objects stored in session and objects stored in session could be serializable. In a Java servlet the session may be retrieve as given:

 

HttpSession session = request.getSession(true); //gives a current session or a new session

//To get/put a value in/from the session

Name name = new Name("Parker");

session.setAttribute("lastname", name); //session.putValue(...) is deprecated as of 2.2

session.getAttribute("lastname");//get a value. session.getValue(...) is deprecated

//If a session is no longer needed e.g. user has logged out, etc then it may be invalidated. session.invalidate();

//you may also set the session inactivity lease period on every session basis session.setMaxInactiveInterval(300);

 

 

1079_Untitled.png

Posted Date: 7/25/2012 3:53:24 AM | Location : United States







Related Discussions:- Why http is a stateless protocol ?, Assignment Help, Ask Question on Why http is a stateless protocol ?, Get Answer, Expert's Help, Why http is a stateless protocol ? Discussions

Write discussion on Why http is a stateless protocol ?
Your posts are moderated
Related Questions
The state chart diagram given below defines the thread states.     1.      Runnable - waiting for its turn to be picked for performing by the thread scheduler based o

For this Assignment, submit the following program: Create an application for an animal-fur trimming service. The business is open 15 weeks of the year, from April through July. The

What is JDBC exactly? Describe the steps required to execute a SQL query using JDBC.

Relation between Stack and Heap Stack and heap are two significant memory areas. Primitives are created on the stack whereas objects are created on heap. This will be further c

Add WordPress color picker to plug-in text field Project Description: I have a simple plug-in that needs the built-in Word Press color picker added to one of the text input f

1. The spring container searches the bean's definition from the XML file and instantiates the bean. 2. Using the dependency injection, spring populates all of the properties as

1. De normalizes your tables where required. 2. Proper use of index columns: An index based on numeric parts is more efficient than an index based on character columns. 3. Re

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

How Polylines draws in java language? Java automatically closes the polygons it draws. That is it draws polygons which look like the one on the right rather than the one on the