Class HttpFilter

    • Constructor Detail

      • HttpFilter

        public HttpFilter()
    • Method Detail

      • init

        public void init​(FilterConfig filterConfig)
                  throws ServletException
        Called by the servlet container when the filter is about to be placed into service. This implementation stores the FilterConfig object for later use by the getter methods. It's recommended to not override this method. Instead, just use init() method. When overriding this method anyway, don't forget to call super.init(config), otherwise the getter methods will throw an illegal state exception.
        Specified by:
        init in interface Filter
        Throws:
        ServletException
      • init

        public void init()
                  throws ServletException
        Convenience init() method without FilterConfig parameter which will be called by init(FilterConfig).
        Throws:
        ServletException - When filter's initialization failed.
      • destroy

        public void destroy()
        Specified by:
        destroy in interface Filter
      • getFilterConfig

        protected FilterConfig getFilterConfig()
        Returns the filter config.
        Returns:
        The filter config.
      • getInitParameter

        protected String getInitParameter​(String name)
        Returns the value of the filter init parameter associated with the given name.
        Parameters:
        name - The filter init parameter name to return the associated value for.
        Returns:
        The value of the filter init parameter associated with the given name.
      • getServletContext

        protected ServletContext getServletContext()
        Returns the servlet context.
        Returns:
        The servlet context.