tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Adams <>
Subject RE: response.sendRedirect
Date Thu, 17 Jan 2002 20:08:09 GMT
<Poking fun>
have you // your session.invalidate and tried it? :) sorry it begged the
my answer is "dunno, try commenting it out and then try it or swapping the
two lines...."
</Poking fun>

-----Original Message-----
From: Jerry Jalenak []
Sent: Thursday, January 17, 2002 2:26 PM
To: ''
Subject: response.sendRedirect

I have the following code snipet in a .JSP...

		if (userStatus.equals ("Failed"))
			session.invalidate() ;			// Kill this
			response.sendRedirect(htmlHome) ;	// Redirect
the user to our home page.
			return ;

When this condition occurs, the response.sendRedirect fails with the
following message:

	javax.servlet.ServletException: Response has already been committed

According to the response object documentation, the sendRedirect 'must be
called before the response is committed (in other words, before the status
code and headers have been written).' Obviously, the response has been
committed, else I wouldn't be getting the error!

My question - is the session.invalidate() doing this to me, or is it
something else that I am completely unaware of?


Jerry Jalenak
LabOne, Inc.

This transmission (and any information attached to it) may be confidential
and is intended solely for the use of the individual or entity to which it
is addressed. If you are not the intended recipient or the person
responsible for delivering the transmission to the intended recipient, be
advised that you have received this transmission in error and that any use,
dissemination, forwarding, printing, or copying of this information is
strictly prohibited. If you have received this transmission in error, please
immediately notify LabOne at (800)388-4675.

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message