Hi,
I have 2 problems:
First One: I have a
servlet which reads a property file and sets all of the properties (name-value pairs in a hashtable) from that files to the servletcontext so that for other servlets there is no need to read the prop file again and again. Any servlets can take the hashtable object from servletcontext and read it. Now is it necessary to synchronize the Hashtable object before storing that to servletcontext. Please note that the hastable is only for the "Read-Only" access.
Second One: It is related to the first one only. In one of the servlets I used following:
ServletContext ctx=getServletContext();
Hashtable myhash=null;
myhash=(Hashtable)ctx.getAttribute("prophash");
private
String mypath=myhash.get("myproppath");
Can I make either of the Hashtable "myhash" or String "mypath" static so that I don't have to fetch the Hashtable or String again and again even from the servlet context.
I am not sure about it. Please correct me wherever I am wrong.
Thanks a lot.