aspose file tools
The moose likes Servlets and the fly likes session probelm Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "session probelm" Watch "session probelm" New topic
Author

session probelm

Jacelyn Yong
Greenhorn

Joined: Feb 16, 2005
Posts: 3
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

Joined: Sep 11, 2005
Posts: 121
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.


keep smilin :: sravan<br /><a href="http://sravanpens.blogspot.com" target="_blank" rel="nofollow">I scribble here</a>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56192
    
  13

"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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
Would you mind to post your code up, so that we can diagnose it better?


SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="http://eddyleesinti.blogspot.com" target="_blank" rel="nofollow">http://eddyleesinti.blogspot.com</a>
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: session probelm
 
Similar Threads
apache authentication with tomcat
Session handling under OAS 9.0.3
Integrating Tomcat security with servlet filter security
GET does not include JSESSIONID
JInternalFrame to get Focus