tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Prideaux" <jpride...@newlifetech.com>
Subject RE: response.sendRedirect
Date Thu, 17 Jan 2002 20:35:05 GMT
Do you have any html tags in your jsp file before the logic you mention?
Also, what jsp spec are you using?

-----Original Message-----
From: Jerry Jalenak [mailto:Jerry.Jalenak@LABONE.com]
Sent: Thursday, January 17, 2002 3:26 PM
To: 'tomcat-user@jakarta.apache.org'
Subject: response.sendRedirect


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

		if (userStatus.equals ("Failed"))
		{
			session.invalidate() ;			// Kill this
session.
			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?

Thanks.

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:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>



--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message