aspose file tools*
The moose likes JSP and the fly likes need help understanding sessions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "need help understanding sessions" Watch "need help understanding sessions" New topic
Author

need help understanding sessions

Nidhi Nagre
Ranch Hand

Joined: Nov 05, 2007
Posts: 64
hi friends

please dont crackle up on me about asking this stupid type question.

i probably understand the session scope around a web application but practically doesn't.

so if datas are to bent from servlet to jsp and vice-versa in a web application, then when datas should be stored in session scope?


thanks in advance
[ November 07, 2007: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61221
    
  66

There's no problem asking what you think might be a stupid question, but Please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

I have adjusted the subject of this post for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61221
    
  66

Session scope is best used for data that is specific to a single user that must exist across the lifetime of multiple request-response cycles.
Nidhi Nagre
Ranch Hand

Joined: Nov 05, 2007
Posts: 64
thanks Mr Bear Bibeault

Is it possible to move array of objects around applet-servlet-applet
communication streams?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Nidhi Nagre:
thanks Mr Bear Bibeault

Is it possible to move array of objects around applet-servlet-applet
communication streams?


In the future, it would be better if you asked separate and unrelated questions in a separate thread (and in a more appropriate forum).

Yes it is possible.
A Google search on "Servlet tunneling" and "Java Object Serialization" should get you going in the right direction.


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

Joined: Nov 11, 2007
Posts: 18
Nidhi... you confused about storing session info and the mvc model and how applets in pages and multple pages...

It works like this... when the first request comes in and you have sessions set... if gives the browser a number...
JSessionID = 173746465238238292932398932
A long unique number...

Then after that the browser regardless of the page or applet comms or whatever always send that number back to the server.
So the data is not actually comming from the browser, just the number is.

From that number its able to look up what you stored previously because the data never left the server.

So... if you get send from a servlet and then get it back in a JSP page or the applet, or next page.... the servler can find it from the sessionID.

Thats more or less it... same trick is uses when you logon in one page and then move to other pages... thats how servlet container remembers you log on.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need help understanding sessions