Search Java Code Snippets


  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.





#Java - Code Snippets for '#Javax.servlet.http.HttpServlet' - 1 code snippet(s) found

 Sample 1. Code Sample / Example / Snippet of javax.servlet.http.HttpServletResponse

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {

HttpServletResponse httpResponse = (HttpServletResponse) response;

try {

filterChain.doFilter(request, response);

}

catch (OverloadedException oe) {

OverloadedException overloadedException = (OverloadedException) oe;

httpResponse.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);

httpResponse.setHeader(HTTP_RETRY_AFTER, "" + overloadedException.getBackoffTime());

}

}


   Like      Feedback      javax.servlet.http.HttpServletResponse



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner