Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot create a session after the response has been committed  RSS feed

 
raghavendra
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everybody,

i am redirecting from jsp page to a servlet as follows

response.sendRedirect("/servlet/LoginServlet?select=en-US");

but i am getting the following error

org.apache.jasper.JasperException: Cannot create a session after the response has been committed

pls can anyone help me

Thanx in Advance
Raghav
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm guessing that you have more code after the call to sendRedirect.
SendRedirect doesn't halt the execution of the JSP/Servlet on it's own.
Add a return statement just after sendRedirect.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!