tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jerry Jalenak" <>
Subject response.sendRedirect
Date Thu, 17 Jan 2002 20:26:00 GMT
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: <>

View raw message