File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Sessions in JSP/Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Sessions in JSP/Servlets" Watch "Sessions in JSP/Servlets" New topic

Sessions in JSP/Servlets

Lucky Narayan

Joined: Mar 29, 2002
Posts: 4
I am a newbie, so treat me gently :-)
My question is in JSP, you have the session concept. But how does this work in real world? Meaning, many of the production env. will have multiple machines (or JVMs) to load balance, correct? The session concept works only when they are all in one single JVM, correct? So, is it that sessions will work ONLY if I know for sure that one machine or one JVM will be used in production environment? Any help/suggestions appreciated!
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
You can try persisting your session data into a common database (which you have to eventually do, anyway ). You might find this javaWorld article interesting.
George Carlson

Joined: Aug 24, 2000
Posts: 15
Hello. I'm a servlet and jsp programmer for Novell where we have a server cluster. I know with us that once a user gets a handle on a server, that ip address will keep the handle on the same server until the server is restarted so this is not a problem
I agree. Here's the link:
subject: Sessions in JSP/Servlets
It's not a secret anymore!