A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
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
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: Doubt about sendRedirect() and RequestDispatcher.forward()
IllegalStateException does not happen. Why not?
AJAX with Struts
Question about redirecting.
sendRedirect curios behavior
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015