public synchronized Filter getFilter() throws ServletException { try { if (_filter == null) { Class filterClass = Class.forName( getClassName() ); _filter = (Filter) filterClass.newInstance(); _filter.init( new FilterConfigImpl( _name, getServletContext(), getInitParams() ) ); } return _filter; } catch (ClassNotFoundException e) { throw new ServletException( "Did not find filter class: " + getClassName() ); } catch (IllegalAccessException e) { throw new ServletException( "Filter class " + getClassName() + " lacks a public no-arg constructor" ); } catch (InstantiationException e) { throw new ServletException( "Filter class " + getClassName() + " could not be instantiated." ); } catch (ClassCastException e) { throw new ServletException( "Filter class " + getClassName() + " does not implement" + Filter.class.getName() ); } }
public synchronized Filter getFilter() throws ServletException { try { if (_filter == null) { Class filterClass = Class.forName( getClassName() ); _filter = (Filter) filterClass.newInstance(); _filter.init( new FilterConfigImpl( _name, getServletContext(), getInitParams() ) ); } return _filter; } catch (ClassNotFoundException e) { throw new ServletException( "Did not find filter class: " + getClassName() ); } catch (IllegalAccessException e) { throw new ServletException( "Filter class " + getClassName() + " lacks a public no-arg constructor" ); } catch (InstantiationException e) { throw new ServletException( "Filter class " + getClassName() + " could not be instantiated." ); } catch (ClassCastException e) { throw new ServletException( "Filter class " + getClassName() + " does not implement" + Filter.class.getName() ); } }
public synchronized Filter getFilter() throws ServletException { try { if (_filter == null) { Class filterClass = Class.forName( getClassName() ); _filter = (Filter) filterClass.newInstance(); _filter.init( new FilterConfigImpl( _name, getServletContext(), getInitParams() ) ); } return _filter; } catch (ClassNotFoundException e) { throw new ServletException( "Did not find filter class: " + getClassName() ); } catch (IllegalAccessException e) { throw new ServletException( "Filter class " + getClassName() + " lacks a public no-arg constructor" ); } catch (InstantiationException e) { throw new ServletException( "Filter class " + getClassName() + " could not be instantiated." ); } catch (ClassCastException e) { throw new ServletException( "Filter class " + getClassName() + " does not implement" + Filter.class.getName() ); } }