A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Java 8 in Action
this week in the
Web Component Certification (SCWCD/OCPJWCD)
Doubt about sendRedirect() and RequestDispatcher.forward()
Joined: Oct 27, 2008
Apr 28, 2013 03:02:10
Normally, we can't do a "RequestDispatcher.forward(...,...)" and a "response.sendRedirect()" after a PrintWriter.flush() but with
, I have no exception.
Is that normal ? :/
PrintWriter out = response.getWriter(); out.print("Test"); out.flush(); RequestDispatcher view = request.getRequestDispatcher("result.jsp"); view.forward(request, response);
PrintWriter out = response.getWriter(); out.print("Test"); out.flush(); response.sendRedirect("http://www.coderanch.com");
With these codes, I have a page with "Test" written.
Creator of Enthuware JWS+ V6
Joined: Apr 07, 2010
Apr 28, 2013 06:35:18
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: Doubt about sendRedirect() and RequestDispatcher.forward()
Question about redirecting.
AJAX with Struts
sendRedirect curios behavior
IllegalStateException does not happen. Why not?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014