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

write a program to find the minimum no of colors to fill a board where some of the elements of different color are already placed.

I have been working on my compiler''s parser now. And for some reason i cant make my parse tree printer to work. SyntaxTree keeps on showing as null when i invoke the print() metho

Diffentiate Local and Global Variables? Local or function level variable effective just in the function in that they are declared although global variables visible everywhere 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

Need java programmer for an assignment "Prepare a program that will accept a sequence of file names as command-line arguments. These files will consist of ASCII text representin

Application Rewrite Project Description: There is an app that I want to be rewritten in order to support multiple profiles. The App is an OTP generator. It is required to

Implement a program to query and update the text database for a library using a client/server model allowing multiple clients safe access to the database, and using a producer-cons

An RMI "service" could well be any Java method that can be invoked remotely. The other service is the JRMP RMI naming service which is a lookup service.

Overall Requirements Every phone number is broken up into sections as shown below: Country Code Area Code Prefix Line Number 1 919 882 5000 Write a program to separate out a ph