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
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:
I agree. Here's the link:
subject: sendRedirect() method with IllegalStateException
How to avoid IllegalStateException (Response Already Commited )
Unable to pass parameters to included url
forward() , sendRedirect()
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015