Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 72566 invoked from network); 13 Feb 2002 16:14:31 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 13 Feb 2002 16:14:31 -0000 Received: (qmail 29256 invoked by uid 97); 13 Feb 2002 16:14:04 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 29223 invoked by uid 97); 13 Feb 2002 16:14:03 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 29183 invoked from network); 13 Feb 2002 16:14:02 -0000 Subject: Re: Redirect after session expires? To: "Tomcat Users List" X-Mailer: Lotus Notes Release 5.0.5 September 22, 2000 Message-ID: From: jeff.guttadauro@abbott.com Date: Wed, 13 Feb 2002 10:14:01 -0600 X-MIMETrack: Serialize by Router on ABTAPN55/ESVR/ABBOTT(Release 5.0.5 |September 22, 2000) at 02/13/2002 10:11:08 AM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N There is no session.isInvalid() method - that wouldn't make any sense anyway. If you have an actual session to ask if it's valid or not, how could it ever be invalid? There is an isNew() method, and I have not used this, but from reading the spec it doesn't sound like it will do the trick. There is a way to define an errorPage, a page that your JSP will forward to if it throws an Exception. <%@ page errorPage="relativeURL" %> You'll have to put this in each of your pages though, so it might not be what you're looking for, although then all the logic to handle the exception would just be in the errorPage. You could also look into binding the session by creating an object that implements HttpSessionBindingListener. Then when the session expires, the valueUnbound( event ) method will be called by the servlet engine. You could put code in that method to handle this case. Hope this helps. -Jeff Michael Molloy To: "Tomcat Users List" Subject: Re: Redirect after session expires? 02/13/02 09:54 AM Please respond to "Tomcat Users List" Well, we're trying to keep as much logic out of the jsps as possible, so if there is a setting for web.xml or something to foward all pages that throw exceptions to a certain url, that's what I'm looking for. I appreciate your suggestion, and if that's what we need to do, we'll do it, but I'd like to know about any other possibilities, also. Thanks --Michael On Wed, 13 Feb 2002 15:37:53 +0000 David Cassidy wrote: > is there a session.isInvalid() method ? > > If so ... :) > > D > > > > Michael Molloy wrote: > > > I've got an application that builds menus when a user logs in and sticks the menus in an object which I then put inside the session. All subsequent jsps get their menu from that object in the session. > > > > However, when their session expires and they try to access a jsp, they get a NullPointerException, as expected. > > > > How can I catch that error and redirect them to the logon page? Or is their some other way to handle it? Is there a better way than putting some if else statements in the jsp to check the session for the menu object? > > > > Thanks > > --Michael > > > > -- > > To unsubscribe: > > For additional commands: > > Troubles with the list: > > > -- > To unsubscribe: > For additional commands: > Troubles with the list: -- To unsubscribe: For additional commands: Troubles with the list: -- To unsubscribe: For additional commands: Troubles with the list: