This discussion is archived
6 Replies Latest reply: Jun 28, 2011 12:20 AM by gimbal2 RSS

Cannot forward after response has been committed

822899 Newbie
Currently Being Moderated
hi everybody,

first of all thank you for your help!!

SO, i am struggling with a exception generated when, I try to forward a redirect to a page i get the next exception, i know it can be caused, cus there other redirect performed.

java.lang.IllegalStateException: Cannot forward after response has been committed

my application tries to connect with a Openid service provider to authenticate using openid4java lib it works as follow:

my servlet receive the request from a form, after the servelet take the parameters (Open Id identifier), after i generate the discovery, association, authetication, process and when i perfomr the redirect or forward i get the exception above mentioned.

i have use the next option to do the redirect


req.getRequestDispatcher(authRequest.getDestinationUrl(true)).include(req, resp);

req.getRequestDispatcher(authRequest.getDestinationUrl(true)).forward(req, resp);

any ideas to know what is happening?

thanks in advanced



  • Correct Answers - 10 points
  • Helpful Answers - 5 points