hi!
you can load your property file once and on every request you can check if
it has been modified, i.e.:

long lastTimeAccessed;
File propsFile = new File("thePropsFile.props");
Map props;

service(req,res) {
    if (propsFile.lastModified()>lastTimeAccessed) {
        lastAccesssedTime = propsFile.lastModified();
        props = new HashMap((Map) new Properties.load(new
FileInputStream(propsFile)));
    }

}

hope this helps!

-mw


| I want to make my servlet more flexible by adding a property file which
will
| guide its behaviour. My problem is I don't know how to put the property
file
| in the RAM memory so that reading the file from the harddisk won't be
| neccessary. (Now I'm just re-reading this file in each thread of the
| servlet)
| Thanks
| [EMAIL PROTECTED]

___________________________________________________________________________
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