org.springframework.boot.web.servlet

Class AbstractFilterRegistrationBean<T extends javax.servlet.Filter>

    • Method Detail

      • setServletRegistrationBeans

        public void setServletRegistrationBeans(java.util.Collection<? extends ServletRegistrationBean<?>> servletRegistrationBeans)
        Set ServletRegistrationBeans that the filter will be registered against.
        Parameters:
        servletRegistrationBeans - the Servlet registration beans
      • getServletNames

        public java.util.Collection<java.lang.String> getServletNames()
        Return a mutable collection of servlet names that the filter will be registered against.
        Returns:
        the servlet names
      • addServletNames

        public void addServletNames(java.lang.String... servletNames)
        Add servlet names for the filter.
        Parameters:
        servletNames - the servlet names to add
      • getUrlPatterns

        public java.util.Collection<java.lang.String> getUrlPatterns()
        Return a mutable collection of URL patterns, as defined in the Servlet specification, that the filter will be registered against.
        Returns:
        the URL patterns
      • addUrlPatterns

        public void addUrlPatterns(java.lang.String... urlPatterns)
        Add URL patterns, as defined in the Servlet specification, that the filter will be registered against.
        Parameters:
        urlPatterns - the URL patterns
      • setDispatcherTypes

        public void setDispatcherTypes(javax.servlet.DispatcherType first,
                                       javax.servlet.DispatcherType... rest)
        Convenience method to set dispatcher types using the specified elements.
        Parameters:
        first - the first dispatcher type
        rest - additional dispatcher types
      • setDispatcherTypes

        public void setDispatcherTypes(java.util.EnumSet<javax.servlet.DispatcherType> dispatcherTypes)
        Sets the dispatcher types that should be used with the registration. If not specified the types will be deduced based on the value of DynamicRegistrationBean.isAsyncSupported().
        Parameters:
        dispatcherTypes - the dispatcher types
      • setMatchAfter

        public void setMatchAfter(boolean matchAfter)
        Set if the filter mappings should be matched after any declared filter mappings of the ServletContext. Defaults to false indicating the filters are supposed to be matched before any declared filter mappings of the ServletContext.
        Parameters:
        matchAfter - if filter mappings are matched after
      • isMatchAfter

        public boolean isMatchAfter()
        Return if filter mappings should be matched after any declared Filter mappings of the ServletContext.
        Returns:
        if filter mappings are matched after
      • getDescription

        protected java.lang.String getDescription()
        Description copied from class: RegistrationBean
        Return a description of the registration. For example "Servlet resourceServlet"
        Specified by:
        getDescription in class RegistrationBean
        Returns:
        a description of the registration
      • addRegistration

        protected javax.servlet.FilterRegistration.Dynamic addRegistration(java.lang.String description,
                                                                           javax.servlet.ServletContext servletContext)
        Specified by:
        addRegistration in class DynamicRegistrationBean<javax.servlet.FilterRegistration.Dynamic>
      • configure

        protected void configure(javax.servlet.FilterRegistration.Dynamic registration)
        Configure registration settings. Subclasses can override this method to perform additional configuration if required.
        Overrides:
        configure in class DynamicRegistrationBean<javax.servlet.FilterRegistration.Dynamic>
        Parameters:
        registration - the registration
      • getFilter

        public abstract T getFilter()
        Return the Filter to be registered.
        Returns:
        the filter
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object