Class WebAppInitializer

  • All Implemented Interfaces:
    org.springframework.web.WebApplicationInitializer

    public class WebAppInitializer
    extends org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer
    implements org.springframework.web.WebApplicationInitializer
    Core REST customization on Spring AbstractAnnotationConfigDispatcherServletInitializer. Register filters to the servlet
    • Field Summary

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

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

        logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.springframework.web.servlet.FrameworkServlet createDispatcherServlet​(org.springframework.web.context.WebApplicationContext servletAppContext)
      Create a RestDispatcherServlet with the specified WebApplicationContext and context config location:com.emc.documentum.rest.context.jc.
      protected org.springframework.web.context.WebApplicationContext createRootApplicationContext()  
      protected Class<?>[] getRootConfigClasses()  
      protected Class<?>[] getServletConfigClasses()  
      protected javax.servlet.Filter[] getServletFilters()
      Specify filters to add and map to the DispatcherServlet.
      protected String[] getServletMappings()
      Specify the servlet mapping(s)to be '/*' for the DispatcherServlet;
      protected String getServletName()
      Return the name under which the DispatcherServlet will be registered.
      void onStartup​(javax.servlet.ServletContext servletContext)  
      protected javax.servlet.FilterRegistration.Dynamic registerServletFilter​(javax.servlet.ServletContext servletContext, javax.servlet.Filter filter)
      Append this filter after other registered Filter
      • Methods inherited from class org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer

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

        customizeRegistration, getServletApplicationContextInitializers, isAsyncSupported, registerDispatcherServlet
      • Methods inherited from class org.springframework.web.context.AbstractContextLoaderInitializer

        getRootApplicationContextInitializers, registerContextLoaderListener
    • Constructor Detail

      • WebAppInitializer

        public WebAppInitializer()
    • Method Detail

      • getRootConfigClasses

        protected Class<?>[] getRootConfigClasses()
        Specified by:
        getRootConfigClasses in class org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer
      • getServletConfigClasses

        protected Class<?>[] getServletConfigClasses()
        Specified by:
        getServletConfigClasses in class org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer
      • getServletMappings

        protected String[] getServletMappings()
        Specify the servlet mapping(s)to be '/*' for the DispatcherServlet;
        Specified by:
        getServletMappings in class org.springframework.web.servlet.support.AbstractDispatcherServletInitializer
        See Also:
        AbstractDispatcherServletInitializer.registerDispatcherServlet(ServletContext)
      • onStartup

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

        protected org.springframework.web.context.WebApplicationContext createRootApplicationContext()
        Overrides:
        createRootApplicationContext in class org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer
      • getServletFilters

        protected javax.servlet.Filter[] getServletFilters()
        Specify filters to add and map to the DispatcherServlet.
        Overrides:
        getServletFilters in class org.springframework.web.servlet.support.AbstractDispatcherServletInitializer
        Returns:
        an array of filters or null
        See Also:
        registerServletFilter(ServletContext, Filter)
      • getServletName

        protected String getServletName()
        Return the name under which the DispatcherServlet will be registered. Defaults to SERVLET_NAME.
        Overrides:
        getServletName in class org.springframework.web.servlet.support.AbstractDispatcherServletInitializer
        See Also:
        AbstractDispatcherServletInitializer.registerDispatcherServlet(ServletContext)
      • createDispatcherServlet

        protected org.springframework.web.servlet.FrameworkServlet createDispatcherServlet​(org.springframework.web.context.WebApplicationContext servletAppContext)
        Create a RestDispatcherServlet with the specified WebApplicationContext and context config location:com.emc.documentum.rest.context.jc.

        Note: This allows for any FrameworkServlet subclass as of 4.2.3. Previously, it insisted on returning a DispatcherServlet or subclass thereof.

        Overrides:
        createDispatcherServlet in class org.springframework.web.servlet.support.AbstractDispatcherServletInitializer
      • registerServletFilter

        protected javax.servlet.FilterRegistration.Dynamic registerServletFilter​(javax.servlet.ServletContext servletContext,
                                                                                 javax.servlet.Filter filter)
        Append this filter after other registered Filter
        Overrides:
        registerServletFilter in class org.springframework.web.servlet.support.AbstractDispatcherServletInitializer
        Parameters:
        servletContext - the servlet context to register filters with
        filter - the filter to be registered
        Returns:
        the filter registration