• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session probelm

 
Jacelyn Yong
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

java.lang.IllegalStateException: Cannot create a session after the response has been committed

i got this error when i try to logon to my web through my logon servlet... why this would happen & what cause this? any solution?


thanks.....
jacelyn (",)>
 
Sravan Kumar
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are trying to create a session after the response had been committed. Have you placed a call to flush() or close() method on the response writer before you create the session?

Once you call these, the response is sent to the client and the request is essentially considered to have been served. Also, check out if you have forwarded the request before you create the session in the servlet. One of these must be the reason.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64961
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"jacelyn ysw",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Eddy Lee Sin Ti
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you mind to post your code up, so that we can diagnose it better?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic