Loading
Is http Stateless

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  Is http Stateless ? How could you maintain the state in a Web Application ?


Ans)

Yes HTTP is stateless, meaning every request is being treated as a new one and
state (data) will not be shared between two http requests, but Servlet
API provide  the some mechanisms address this issue. Below are Servlet
state management techniques.

i) Use POST/GET variables to pass info from page to page.  (Hidden Variables)
     <input type='hidden' name='userName'>
     request.getParameter ('userName');

ii) Use the session to store information.
     session.setAttribute("userName", "testUser");
     value = session.getAttribute("userName");

iii) Use cookies to store information.
     Cookie cookie = new Cookie("CName","Cookie Value");
    cookie.setMaxAge(100);
    response.addCookie(cookie);



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

Is http Stateless


Is http Stateless

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free