tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jerry Jalenak" <Jerry.Jale...@LABONE.com>
Subject RE: response.sendRedirect
Date Thu, 17 Jan 2002 20:34:59 GMT
Yeah, I have.  I'm also getting it now outside of the snipnet, when I am
just wanting to redirect to another page.  Should I be using <jsp:forward>
instead?

Jerry

-----Original Message-----
From: Brian Adams [mailto:badams@AEM-TX.com]
Sent: Thursday, January 17, 2002 2:08 PM
To: 'Tomcat Users List'
Subject: RE: response.sendRedirect


<Poking fun>
have you // your session.invalidate and tried it? :) sorry it begged the
question! 
my answer is "dunno, try commenting it out and then try it or swapping the
two lines...."
</Poking fun>

-----Original Message-----
From: Jerry Jalenak [mailto:Jerry.Jalenak@LABONE.com]
Sent: Thursday, January 17, 2002 2: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>


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>


Mime
View raw message