org.springframework.boot.web.servlet

Class RegistrationBean

  • java.lang.Object
    • org.springframework.boot.web.servlet.RegistrationBean
    • Field Summary

      • Fields inherited from interface org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Constructor Summary

      Constructors 
      Constructor and Description
      RegistrationBean() 
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      protected abstract java.lang.String getDescription()
      Return a description of the registration.
      int getOrder()
      Get the order of the registration bean.
      boolean isEnabled()
      Return if the registration is enabled.
      void onStartup(javax.servlet.ServletContext servletContext)
      Configure the given ServletContext with any servlets, filters, listeners context-params and attributes necessary for initialization.
      protected abstract void register(java.lang.String description, javax.servlet.ServletContext servletContext)
      Register this bean with the servlet context.
      void setEnabled(boolean enabled)
      Flag to indicate that the registration is enabled.
      void setOrder(int order)
      Set the order of the registration bean.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RegistrationBean

        public RegistrationBean()
    • Method Detail

      • onStartup

        public final void onStartup(javax.servlet.ServletContext servletContext)
                             throws javax.servlet.ServletException
        Description copied from interface: ServletContextInitializer
        Configure the given ServletContext with any servlets, filters, listeners context-params and attributes necessary for initialization.
        Specified by:
        onStartup in interface ServletContextInitializer
        Parameters:
        servletContext - the ServletContext to initialize
        Throws:
        javax.servlet.ServletException - if any call against the given ServletContext throws a ServletException
      • getDescription

        protected abstract java.lang.String getDescription()
        Return a description of the registration. For example "Servlet resourceServlet"
        Returns:
        a description of the registration
      • register

        protected abstract void register(java.lang.String description,
                                         javax.servlet.ServletContext servletContext)
        Register this bean with the servlet context.
        Parameters:
        description - a description of the item being registered
        servletContext - the servlet context
      • setEnabled

        public void setEnabled(boolean enabled)
        Flag to indicate that the registration is enabled.
        Parameters:
        enabled - the enabled to set
      • isEnabled

        public boolean isEnabled()
        Return if the registration is enabled.
        Returns:
        if enabled (default true)
      • setOrder

        public void setOrder(int order)
        Set the order of the registration bean.
        Parameters:
        order - the order
      • getOrder

        public int getOrder()
        Get the order of the registration bean.
        Specified by:
        getOrder in interface org.springframework.core.Ordered
        Returns:
        the order