Class AbstractAcrossServletInitializer

java.lang.Object
org.springframework.web.context.AbstractContextLoaderInitializer
org.springframework.web.servlet.support.AbstractDispatcherServletInitializer
com.foreach.across.modules.web.servlet.AbstractAcrossServletInitializer
All Implemented Interfaces:
org.springframework.web.WebApplicationInitializer

public abstract class AbstractAcrossServletInitializer extends org.springframework.web.servlet.support.AbstractDispatcherServletInitializer
Initializes a single dispatcher servlet with a root Application context that is initialized upon creation. This allows any modules in the root Application context to extend the ServletContext.

Servlet 3 environments only need to extend this initializer and configure the application context with one or more configuration classes or locations. Any AcrossContext bootstrapped in the ApplicationContext will be able to extend the ServletContext.

Author:
Arne Vandamme
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     

    Fields inherited from class org.springframework.web.servlet.support.AbstractDispatcherServletInitializer

    DEFAULT_SERVLET_NAME

    Fields inherited from class org.springframework.web.context.AbstractContextLoaderInitializer

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    Configure the ApplicationContext before it is initialized.
    protected org.springframework.web.context.WebApplicationContext
     
    protected org.springframework.web.context.WebApplicationContext
    Creates a default empty WebApplicationContext for the servlet itself.
    protected void
    customizeRegistration(jakarta.servlet.ServletRegistration.Dynamic registration)
     
    protected void
    extendServletContext(jakarta.servlet.ServletContext servletContext)
    Extension point for extending the ServletContext during initialization.
    protected String[]
     
    void
    onStartup(jakarta.servlet.ServletContext servletContext)
     
    protected void
    registerContextLoaderListener(jakarta.servlet.ServletContext servletContext)
     

    Methods inherited from class org.springframework.web.servlet.support.AbstractDispatcherServletInitializer

    createDispatcherServlet, getServletApplicationContextInitializers, getServletFilters, getServletName, isAsyncSupported, registerDispatcherServlet, registerServletFilter

    Methods inherited from class org.springframework.web.context.AbstractContextLoaderInitializer

    getRootApplicationContextInitializers

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • AbstractAcrossServletInitializer

      public AbstractAcrossServletInitializer()
  • Method Details

    • onStartup

      public void onStartup(jakarta.servlet.ServletContext servletContext) throws jakarta.servlet.ServletException
      Specified by:
      onStartup in interface org.springframework.web.WebApplicationInitializer
      Overrides:
      onStartup in class org.springframework.web.servlet.support.AbstractDispatcherServletInitializer
      Throws:
      jakarta.servlet.ServletException
    • registerContextLoaderListener

      protected void registerContextLoaderListener(jakarta.servlet.ServletContext servletContext)
      Overrides:
      registerContextLoaderListener in class org.springframework.web.context.AbstractContextLoaderInitializer
    • createRootApplicationContext

      protected org.springframework.web.context.WebApplicationContext createRootApplicationContext()
      Specified by:
      createRootApplicationContext in class org.springframework.web.context.AbstractContextLoaderInitializer
    • configure

      protected abstract void configure(AcrossWebApplicationContext applicationContext)
      Configure the ApplicationContext before it is initialized.
      Parameters:
      applicationContext - AcrossWebApplicationContext that contains the main Across context configuration.
    • createServletApplicationContext

      protected org.springframework.web.context.WebApplicationContext createServletApplicationContext()
      Creates a default empty WebApplicationContext for the servlet itself.
      Specified by:
      createServletApplicationContext in class org.springframework.web.servlet.support.AbstractDispatcherServletInitializer
    • getServletMappings

      protected String[] getServletMappings()
      Specified by:
      getServletMappings in class org.springframework.web.servlet.support.AbstractDispatcherServletInitializer
    • extendServletContext

      protected void extendServletContext(jakarta.servlet.ServletContext servletContext)
      Extension point for extending the ServletContext during initialization.
      Parameters:
      servletContext - ServletContext while initialization is busy.
    • customizeRegistration

      protected void customizeRegistration(jakarta.servlet.ServletRegistration.Dynamic registration)
      Overrides:
      customizeRegistration in class org.springframework.web.servlet.support.AbstractDispatcherServletInitializer