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 ?

Describe life cycle of thread, Describe life cycle of thread. Threads f...

Describe life cycle of thread. Threads follow the single flow of control. A thread is execution in a program. The life cycles of threads are listed below: Newborn state: A

Develop a visual design in java, Player Ship Appearance: • Your ship mu...

Player Ship Appearance: • Your ship must be either a nice-looking sphere (left image above), or a nice-looking sphere with a "mouth" (middle image above), depending on variant.

Online super market Applivation, i don''t need any code i need analysis an...

i don''t need any code i need analysis and design only -i need 4 use cases - description - activity diagram -sequence diagram -class diagram - data base diagram

Retrieving data from Excel file , how to retrieve data from Excel file, and...

how to retrieve data from Excel file, and display that data in table on jsp page?

Prepare a small android application, Android App Project Description: ...

Android App Project Description: I am seeking an experienced individual to prepare a small android application The only difference is that I would like movement to be done

Use case diagram, Depicts the typical communication between external users ...

Depicts the typical communication between external users and the system. The emphasis is on what a machine does rather than how it works it. A use case is a summary of scenarios fo

Decision structures, for $9.95 per month, 10 hours of access are provided.A...

for $9.95 per month, 10 hours of access are provided.Additional hours are $2.00 per hour

Questions pseudocodes, 1. Write the pseudocode to get the input of 10 integ...

1. Write the pseudocode to get the input of 10 integers from the user and add them up and output the total. (4 points) 2. Compute the output of following pseudocode. Assume that

Relation between stack and heap, Relation between Stack and Heap Stack ...

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

String, in java string is a

in java string is a

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