Try tu use a global class that is initiated when the server starts.
So every time you need to read or change call setXXX respectively getXXX
methods on that object.
To gain persistency you can serialize the global object or save his member
variables when they are changed.

public class Enviroment {
        private int var1;
        private String var2;

        public int getVar1 (){
                return (var1);
        };

        public void setVar2 (String newValue) {
                synchronized ( var2){
                        var2 = newValue;
                };
        };


        public Enviroment (String propsFile){
                // iinit class members
        };
};


Nic Tanase


-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Praveen Tapashetti
Sent: Monday, March 05, 2001 4:58 PM
To: [EMAIL PROTECTED]
Subject: resource bundle problem


Hi,

I am using resource bundle (properties file) to store some variables and
call them in the servlet.
First time when the servlet is loaded, resource bundle variables are read.

But when I change resource bundle variables ( in the properties file) and
servlet is invoked, it still takes old values as it will be cached in JVM at
server side.

But I want a feature in which every time properties file is changed, new
values should be loaded without restarting the server. Is there any
work-around for this??
Regards
Praveen Tapashetti
Mascot Systems Ltd
Chennai, India

Tel:   91-44-2301236 Extn: 3321

___________________________________________________________________________
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

Reply via email to