you have to append a "return;" - statement after the redirect, because the current page will be rendered, too
cheers pero > -----Original Message----- > From: Mark Meany [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 31, 2002 2:03 PM > 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:[EMAIL PROTECTED]> > For additional commands: <mailto:[EMAIL PROTECTED]> > Troubles with the list: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
