I am working on a web application, in which I am reading some configuration data stored in xml file from a Servlet. I want the data read from this servlet available to all the requests coming to this servlet. So inside the init() method of this servlet I am initializing global variable , which will have content read from this xml file so that all the request coming to this servlet will have this data available and don't have to read from the xml file again and again.
My first question is, is this method is better way to share data among request coming only to this servlet. I don't want to share it across all the servlets.
my second question is , If somebody update this xml file. Is there way to provide these updates to the servlet without server restart. For example, from the web application it self. there is a web page to update the xml file adding new configuration entries or modifying existing entries. So it is possible that user will expect that those newly added configuration to be available without server restart
Aucun commentaire:
Enregistrer un commentaire