public static void sendRedirect ( HttpServletResponse response , String location , int status ) throws IllegalStateException , IOException { // Response must not be committed if ( response . isCommitted ( ) ) throw new IllegalStateException ( "Unable to redirect: Response already committed" ) ; response . setHeader ( "Location" , location ) ; response . sendError ( status ) ; }
Sends a redirect to the provided absolute URL location .