public final ServletContext getServletContext ( ) { switch ( type ) { case ServletConfig : return servletConfig . getServletContext ( ) ; case FilterConfig : return filterConfig . getServletContext ( ) ; case ServletContext : return servletContext ; default : throw new IllegalStateException ( ) ; } }
Gets the servlet context from the config .