tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Layman <randy.lay...@aswethink.com>
Subject RE: Junk after session expired
Date Thu, 31 Jan 2002 14:01:48 GMT

	You need to add "return;" after calling sendRedirect.  All
sendRedirect does is to call setHeader with the appropriate values for you,
its still up to you to cancel out of the remainder of the page's logic.

	Randy

> -----Original Message-----
> From: Mark Meany [mailto:MMeany@ordsvy.gov.uk]
> Sent: Thursday, January 31, 2002 8:03 AM
> To: 'Tomcat Users List'
> Subject: Junk after session expired
> 
> 
> Hope someone can help:
> 
> Config: Win NT, Tomcat 3.2.3, Apache 1.3.2 ( according to 
> bundled changes
> log).
> 
> Have configured a simple JSP app that starts at a login page 
> and maintains a
> session bean across pages.
> 
> At the start of each page we need to check for no 
> session/session expired.
> If this is the case then response.sendRedirect() is used to 
> redirect to a
> page that explains this:-
> 
> ----------------------- Start of *.jsp 
> -------------------------------------
> <%@ page language="java" %>
> <%
>     HttpSession oldSession = request.getSession(false);
>     if( oldSession == null ) {
>         response.sendRedirect( response.encodeRedirectURL(
> "../jsp/no_session.jsp" ) );
>     }
> %>
> --------------------- Rest of *.jsp would follow here
> ---------------------------
> 
> This just does not work as we would like. When a redirect happens the
> generated html page, no_session.jsp, gets filled with 
> rubbish. It is as if
> there is a buffer that is not being flushed somewhere.
> 
> I have noticed in the 'rubbish' that gets displayed the odd exception
> (invalid state on one occasion), but this is not consistent 
> and more often
> displays fragments of HTML from the target page.
> 
> Advice welcomed.
> 
> Cheers, Mark.
> 
> 
> 
> 
> ***************************************************************
> For more information on Ordnance Survey products and services,
> visit our web site at http://www.ordnancesurvey.co.uk
> ***************************************************************
> 
> 
> 
> 
> --
> 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