/** * Sets the filter's {@link #setFilterConfig filterConfig} and then immediately calls * {@link #onFilterConfigSet() onFilterConfigSet()} to trigger any processing a subclass might wish to perform. * * @param filterConfig the servlet container supplied FilterConfig instance. * @throws javax.servlet.ServletException if {@link #onFilterConfigSet() onFilterConfigSet()} throws an Exception. */ public final void init(FilterConfig filterConfig) throws ServletException { setFilterConfig(filterConfig); try { onFilterConfigSet(); } catch (Exception e) { if (e instanceof ServletException) { throw (ServletException) e; } else { if (log.isErrorEnabled()) { log.error("Unable to start Filter: [" + e.getMessage() + "].", e); } throw new ServletException(e); } } }