Class ConfigurationServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
nl.vpro.web.servlet.ConfigurationServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class ConfigurationServlet extends jakarta.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: