In servlert code there is static Hashtable which is exclusivelly populated in init(). In doGet() the table is read only. Would it be safe to replace Hashtable with HashMap. Is HashMap safe for multiple thread read?
Well, if your original Hashtable is read only, it will be safe. But if there're places to put objects in it. You should take care, because HashMap is not synchronized at all. But even Hashtable, at method level, it's synchronized, but at transaction level, it's not, it depends on you. So you should always write code like this when you wanna change the state of Hashs (Whatever it is Hashtable or HashMap):