Class ConfigurationServlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class ConfigurationServlet
    extends javax.servlet.http.HttpServlet
    Serves a 'configuration.js' for javascript clients. Expects an init param "name" with that it determines the 'environment' via
    • Either it is the system property vpro.[name].env
    • If that is missing it is the application context variable vpro/[name]/env
    • If that is missing too, it is ConfigurationServlet.Environment.PROD
    Then it loads properties from all of:
    • The resource [name].properties
    • The resource [name].[env];properties (if exists)
    • The file /WEB-INF/classes/[name].properties (if exists)
    • The file /WEB-INF/classes/[name].[env];properties (if exists)
    • The file ${user.home}/conf/[name].properties (if exists)
    • The file ${user.home}/conf/[name].[env];properties (if exists)
    while it overrides already defined ones.

    The result is then, together with some other properties returned in a javascript structure.

    Since:
    0.3
    Author:
    Michiel Meeuwissen
    See Also:
    Serialized Form