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
I want to upload an item object with it''s image is it possible that i pass a complete object of my Item along with it''s image from my Controller if yes then how may i Do it? an

Purpose Demonstrate your ability to ability to use Java data and control structures. Draw with the aid of conditionals and loops. Background Thought A note on comments:

Get info from website using javascript Project Description: I need to extract the text from all the available (red, blue) seats of all the events on this site without getting

Number = new Array(5); var abc=4; for(var i=1; i { Number[i]= abc*i; } Number.reverse(); for(j=0;j { document.write(" "+Number[j]+" "); } A) What should be output of above co

I need 3D Globe (Android) application Project Description: Seeking a talented android programmer to prepare a simple app for Android tablet display which can feature a 3D glo

What is best algorithm? Greedy algorithm is the best algorithm as it is n algorithm in which always takes the best immediate, or local solution although searching an answer.


A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Modify your UserProfile class to meet the following requirements: It must include a field called wall to store an ArrayList of wall posting objects. It must also provide

write algorithm to perform the following operations on it create,insertion,deletion,for testing overflow and empty conditions.