servletconfig

How to portably read configuration data from a servlet

耗尽温柔 提交于 2019-11-28 06:58:12
I'm writing a Java servlet that needs to read some site-specific configuration data; I would like it to be easily accessible/modifiable by the sysadmins at deployment time. There is no sensible default, so the data has to be provided by the site admin. It consists of a few string key/value pairs (think Properties). It would only be read once (at initialization time). I'm aware of this SO question and the ServletContext.getInitParameter() mechanism, but as far as my understanding goes, they require the data to be bundled in the servlet package (either as a properties file, or specified in the

Dynamically add a servlet to the servletConfig

≯℡__Kan透↙ 提交于 2019-11-27 18:06:55
问题 I have a Java web application that uses a plugin architecture. I would like to know if anyone has a solution where by one could add a servlet, with serlvet mapping to the servletconfig while the web app is running? The idea being that a class could be added to the /WEB-INF/classes folder and be made active as a servlet without restarting the web app. By the same nature, if the user chooses to remove the "plugin" then have the code remove the class from the the servletconfig. 回答1: There is no

How to portably read configuration data from a servlet

北慕城南 提交于 2019-11-27 01:38:39
问题 I'm writing a Java servlet that needs to read some site-specific configuration data; I would like it to be easily accessible/modifiable by the sysadmins at deployment time. There is no sensible default, so the data has to be provided by the site admin. It consists of a few string key/value pairs (think Properties). It would only be read once (at initialization time). I'm aware of this SO question and the ServletContext.getInitParameter() mechanism, but as far as my understanding goes, they