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
      • init

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

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

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

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

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