This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes How to maintain Session Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "How to maintain Session" Watch "How to maintain Session" New topic
Author

How to maintain Session

rushikesh kale
Ranch Hand

Joined: Jan 25, 2005
Posts: 41

Hi Freinds!
In one interview interviewer ask me a question about "How to maintain a scope of session throughout the application?"
At that time I gave some wayword answer
So please give me some information about this.
Thanks in Advanced!
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

At that time I gave some wayword answer

Sounds like a wayward question.
Did he explain it at all?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
sweta naidu
Greenhorn

Joined: Nov 02, 2004
Posts: 25
if i am not mistaken it maintains automatically throughout the application.
rushikesh kale
Ranch Hand

Joined: Jan 25, 2005
Posts: 41

Well My wayword answer was "If we dosen't initialize or create another new session then that session will maintain throuout" Then he ask me "How to retrive the value of first page on last page without storing it in a database?"
at that time I became clueless! So can you explain me this?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Sounds like he wanted you to explain how to bind objects (variables) to session scope and then retrieve them in another request.



http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSession.html

Pay particular attention to setAttribute and getAttribute.
Understanding variable scoping is a pretty fundamental requirement in Servlet/JSP programming.
[ April 22, 2005: Message edited by: Ben Souther ]
 
 
subject: How to maintain Session
 
Similar Threads
Global/Session variable in netbeans
MainTain Session in swing
Maintain Session with Thread Safe
Does jsf accept ArrayList?
Maintaing sessions between various web servers