> -----Original Message----- > From: Sebastian Hagenbrock [mailto:[EMAIL PROTECTED]] > Sent: 03 December 2001 14:36 > To: Tomcat Maillist > Subject: How to create global variables wich could be accessed by all > jsp sites and servlet's? > > Hi, > > I've found nothing about how to save Variables wich are stored globally in > reference to one context. > > Normally I handle the variables in session objects for each user. But I've > some preferences wich should be read only once at the start of the tomcat > server and then always only read by the classes/jsp sites. > > I need it, because the initialisation of these variables consumes much time, > and i have running it now for each new created session object. But it is > only needed once at the servers startup. > > How to do that? > > Thx > > SH >[...]
there are already other ways in other repling-emails, the following is my suggestions: if you want to make your Variables visible inside-context, I think you also can save them with: - javax.servlet.ServletContext.getAttribute/setAttribute - use a class which wrap your variables as a "data container", and put this class together with your Servlet class. if you want to make your Variables visible cross-context, I think you also can save them with: - use a class which wrap your variables as a "data container", and put this class in JAKARTA_HOME/common/classes or JAKARTA_HOME/shared/classes(JAKARTA_HOME/classes) Bo Dec.03, 2001 -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>