Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Web Component Certification (SCWCD/OCPJWCD)
sendRedirect() method with IllegalStateException
Joined: Sep 08, 2012
Sep 08, 2012 12:33:21
I am doing this in my doGet method:
PrintWriter pw = response.getWriter(); pw.write("it is commited"); // This is commited response.sendRedirect("myUrl"); // you can't do this, gets run time exception, saying all ready commited.
why I am not getting
? how can I get one ?
I am preparing for SCWCD exams
it is compiling and I am redirected to myUrl
Creator of Enthuware JWS+ V6
Joined: Apr 07, 2010
Sep 08, 2012 13:52:33
Have you checked the following discussion:
It is sorta covered in the
JavaRanch Style Guide
subject: sendRedirect() method with IllegalStateException
forward() , sendRedirect()
How to avoid IllegalStateException (Response Already Commited )
Unable to pass parameters to included url
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013