Class ServletManager

java.lang.Object
org.frankframework.lifecycle.ServletManager
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware

public class ServletManager extends Object implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, org.springframework.web.context.ServletContextAware

Enables the use of programmatically adding servlets to the given ServletContext.
Run during the ApplicationServers contextInitialized phase, before starting servlets. This ensures that all (dynamic) servlets are created, before servlets are being created. This in turn avoids a ConcurrentModificationException if this where to be done during a servlet initialization phase.

When dtap.stage is set to LOC, the default behavior of each servlet is not-secured (no authentication) on HTTP.
When dtap.stage is NOT set to LOC, the default behavior of each servlet is secured (authentication enforced) on HTTPS.

To change this behavior the following properties can be used; servlet.servlet-name.transportGuarantee - forces HTTPS when set to CONFIDENTIAL, or HTTP when set to NONE
servlet.servlet-name.securityRoles - use the default IBIS roles or create your own
servlet.servlet-name.urlMapping - path the servlet listens to
servlet.servlet-name.loadOnStartup - automatically load or use lazy-loading (affects application startup time)
servlet.servlet-name.authenticator - enables authentication on this endpoint

NOTE: Both CONTAINER and NONE are non-configurable default authenticators.
Author:
Niels Meijer
  • Constructor Details

    • ServletManager

      public ServletManager()
  • Method Details

    • getServletContext

      protected jakarta.servlet.ServletContext getServletContext()
    • getDeclaredRoles

      public List<String> getDeclaredRoles()
    • setServletContext

      @Autowired @Lazy public void setServletContext(jakarta.servlet.ServletContext servletContext)
      Specified by:
      setServletContext in interface org.springframework.web.context.ServletContextAware
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • startAuthenticators

      public void startAuthenticators()
    • declareRoles

      public void declareRoles(List<String> roleNames)
      Register a new role
      Parameters:
      roleNames - String or multiple strings of roleNames to register
    • register

      public void register(ServletConfiguration config)
    • getServlet

      public ServletConfiguration getServlet(String name)
    • getServlets

      public Collection<ServletConfiguration> getServlets()
    • getTransportGuarantee

      public static jakarta.servlet.annotation.ServletSecurity.TransportGuarantee getTransportGuarantee(String propertyName)
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware