I've spent more than ten hours searching for a viable solution to this problem. I've read a lot of stuff, and I wouldn't put a question onto this mailing list if I've found a way to solve this on my own. I believe people subscribe to this mailing list to get help from other developers as well to share experiences. (I might be wrong...) And yes, I am new to Java, but it didn't say anything when I signed up for this mailing list that you're not allowed to ask beginners questions.
As for books... In Teach Yourself Java 2 In 21 Days says on page 67: "Unlike other languages, Java does not have global variables (variables that can be used in all parts of a program.). Instance and class variables are used to communicate information from one object to another, and these replace the need for global variables." And this explanation wasn't good enough. I wished to have _an object that can be reached by two different users, running different servlets at the same time_. Thanks for the links, I'll see if I can find the information I need. ServletContext might do the trick. Sorry for asking. ----- Original Message ----- From: "Christopher K. St. John" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 07, 2002 12:04 AM Subject: Re: "Global" objects > Gert Grenander wrote: > > > > I've come to the understanding that you can't use "global" > > objects in Java if you're not doing it with RMI. > > > > I'm completely failing to understand what you're trying > to say. That could be my fault, or it could be yours. > From the sound of it, you may be a little shakey on some > basic Java concepts. It would really help to take an hour > or two and read the Java Tutorial, or a good Java book. > The Java Tutorial is free, and is available online at: > > http://java.sun.com/docs/books/tutorial/ > > If you're entirely clear on the whole Java thing, then > never mind, my bad. But in any case.. > > You can put data that is to be shared between the > servlets in a web application into the servlet context. > See the javadocs for javax.servlet.ServletContext. If > you're unsure about the phrases 'web application' and > 'servlet context' try one of the tutorials at: > > http://java.sun.com/products/servlet/technical.html > > and definitely take a gander at the servlet spec: > > http://java.sun.com/products/servlet/download.html > > The spec is a very easy read, no servlet programmer > should be without it. > > I don't mean to put you off by telling you to go read > a tutorial, it's just that it's impossible to distill > a very general explanation a single email message. > > It might help if you could be a little more specific > about exactly what you're trying to do... > > -- > Christopher St. John [EMAIL PROTECTED] > DistribuTopia http://www.distributopia.com > > ___________________________________________________________________________ > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > > ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
