if ( count > limit ) { HttpServletResponse httpRes = (HttpServletResponse)res; httpRes.sendError( httpRes.SC_SERVICE_UNAVAILABLE, "Too Busy."); } else { ++count; chain.doFilter( req, res ); --count; }
String s = filterConfig.getInitParameter("limit"); if ( s == null ) throw new ServletException("Missing init parameter: "+limit); limit = Integer.parseInt( s );