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 ?

How to wrapping your own packages in java, How to Wrapping Your Own Package...

How to Wrapping Your Own Packages in java? Java does not limit you to using just the system supplied packages. You can write your own as well. You write packages just such as

Explain java is fully object oriented languages or not, No, java is not ful...

No, java is not fully object oriented language due to it does not support "multiple inheritance" and "pointers" which are used in C++. But, by using Interfaces we can execute multi

Continue statement in javascript, It terminates execution of the block of s...

It terminates execution of the block of statements in while or for loop & continues execution of the loop along with the next iteration. On the contrary to the break statement, con

Develop a geonetwork template, Develop a GeoNetwork Template Project Des...

Develop a GeoNetwork Template Project Description: Want a personalized GeoNetwork Template with the consideration of the logo included to this proposal and its colors. The ba

Rfid based student attendance system include biometrics, Develop a rfid bas...

Develop a rfid based student attendance system include biometrics Project Description: The aim of our project is using rfid technology student attendance has to be taken. whe

Find representative skyline points in to 2 dimensional data, Find represent...

Find representative skyline points in to two dimensional data Project Description: Run skyline algorithm run representative skyline algorithm up to skyline algorithm (Affi

java garbage collector? , Each time an object is operated in Java, it goes...

Each time an object is operated in Java, it goes into the area of memory named as heap. The Java heap is named the garbage collectable heap. The garbage collection may not be force

Relate java with C/C++, Relate Java with C/C++ Very similar C/C++ synta...

Relate Java with C/C++ Very similar C/C++ syntax, operators, etc. Core language is simpler than C++ -- no pointers, no operator overloading, and no multiple inheritance.

Area under curve., write a program to find the area under the curve y=f(x) ...

write a program to find the area under the curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b.   #include float start_point,

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