Class DynamicVariablesServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.netscape.cms.servlet.base.CMSServlet
com.netscape.cms.servlet.base.DynamicVariablesServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class DynamicVariablesServlet extends CMSServlet
Return some javascript to the request which contains the list of dynamic data in the CMS system.

This allows the requestor (browser) to make decisions about what to present in the UI, depending on how CMS is configured

Version:
$Revision$, $Date$
See Also:
  • Field Details

  • Constructor Details

    • DynamicVariablesServlet

      public DynamicVariablesServlet()
  • Method Details

    • getServletInfo

      public String getServletInfo()
      Returns serlvet information.
      Specified by:
      getServletInfo in interface javax.servlet.Servlet
      Overrides:
      getServletInfo in class javax.servlet.GenericServlet
    • init

      public void init(javax.servlet.ServletConfig sc) throws javax.servlet.ServletException
      Reads the following variables from the servlet config:
      • AuthMgr - the authentication manager to use to authenticate the request
      • GetClientCert - whether to request client auth for this request
      • authority - the authority (ca, ra, drm) to return to the client
      • dynamicVariables - a string of the form: serverdate=serverdate(),subsystemname=subsystemname(), http=http(),authmgrs=authmgrs(),clacrlurl=clacrlurl()
      The dynamicVariables string is parsed by splitting on commas. When services, the HTTP request provides a piece of javascript code as follows.

      Each sub expression "lhs=rhs()" forms a javascript statement of the form lhs=xxx; Where lhs is xxx is the result of 'evaluating' the rhs. The possible values for the rhs() function are:

      • serverdate() - the timestamp of the server (used to ensure that the client clock is set correctly)
      • subsystemname()
      • http() - "true" or "false" - is this an http connection (as opposed to https)
      • authmgrs() - a comma separated list of authentication managers
      • clacrlurl() - the URL to get the CRL from, in the case of a Clone CA. This is defined in the CMS configuration parameter 'cloning.cloneMasterCrlUrl'
      Specified by:
      init in interface javax.servlet.Servlet
      Overrides:
      init in class CMSServlet
      Throws:
      javax.servlet.ServletException
      See Also:
      • Servlet.init(ServletConfig)
    • service

      public void service(javax.servlet.http.HttpServletRequest httpReq, javax.servlet.http.HttpServletResponse httpResp) throws javax.servlet.ServletException, IOException
      Overrides:
      service in class CMSServlet
      Throws:
      javax.servlet.ServletException
      IOException