File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
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
subject: Doubt about sendRedirect() and RequestDispatcher.forward()
IllegalStateException does not happen. Why not?
sendRedirect curios behavior
AJAX with Struts
Question about redirecting.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014