Why http is a stateless protocol ?, JAVA Programming

Assignment Help:

 

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


Related Discussions:- Why http is a stateless protocol ?

What is the comparable interface, What is the Comparable interface? Com...

What is the Comparable interface? Comparable interface is used to sort arrays and collections of objects using collections.sort() and java.utils. Objects of the class implement

Algorithm, write algorithm to perform the following operations on it create...

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

Prepare a new fishing app, New Fishing App Project Description: A new...

New Fishing App Project Description: A new app for iPhone providing a GPS connected map of the fishery you are fishing at and other logged in users who are also fishing at th

What should be output of above code, Number = new Array(5); var abc=4; for(...

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

Name the common bugs which are not possible in java, Name the common bugs w...

Name the common bugs which are not possible in java Many common bugs and security problems (such as "buffer overflow") are not possible in java. Checks also make it easier to f

Answer, a program to find the area under curve y=f(x) between x=a and x=b,i...

a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b

Minimumshelf, Write a program that finds the minimum total number of shelve...

Write a program that finds the minimum total number of shelves, including the initial one required for this loading process

Nonrecursive implementations of the min() and floor() method, Write nonrecu...

Write nonrecursive implementations of the min() and floor() methods in BST.java. Make sure to use only one return in your method. Use an insertion sort (discussed in class) to s

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd