On Mon, 21 Oct 2002 [EMAIL PROTECTED] wrote:

> Thanks for the comments, Milt.
>
> From a JSP (To my understanding anyway - I just re-checked it in a
> book) - it would appear you CAN assume the session object is not
> null - I quote: 'An implicit script language variable of type
> javax.servlet.http.HttpSession is available for use in the page,
> with the name session.  It will represent the existing session, or
> if there is no session existing already a new session will be
> created.' - unless one sets explicitly to not use sessions, anyway
> :)
>
> Granted, if I had pulled the session out of the HttpServletRequest -
> that would be another matter and it would be wise to check whether
> that session object was null or not.
>
> But - anyway - we're splitting hairs :)

Ah, OK, I'm more used to using sessions in servlets, not JSPs, so I
wasn't 100% sure about this.


> And you're right - I didn't address the question as it was asked but
> I guess I read it wrong!  No matter!
>
> I believe Dave (who replied earlier) might be on the right track
> with the HttpSessionListener class but I would have to play around
> with that a bit to see how it works!

Well, some of the session stuff should help -- but depending on
exactly what they want to do, they may need to roll their own, at
least for some of it.


> -----Original Message-----
> From: Milt Epstein [mailto:mepstein@;uiuc.edu]
> Sent: Monday, October 21, 2002 3:04 PM
> To: Tomcat Users List
> Subject: RE: Session Time out - Tomcat
>
>
> On Mon, 21 Oct 2002 [EMAIL PROTECTED] wrote:
>
> > Lior,
> >
> > One easy way to do this is to store something in the session when
> > you log the user on (a user name or some unique piece of
> > information) - you probably already do this - and when you do any
> > jsps or servlets, try doing session.getAttribute on that item - if
> > its null - the session is timed out.
> >
> > I am sure there are other ways to do this but this is definitely an
> > easy way to do it!
>
> I think this is an easy way to get NullPointerException's as well :-).
> (You're not checking that session is not null, and I don't think you
> can assume that.)
>
> And I don't think you're really addressing the original question
> (although I'm not sure the original question is so clear).
>
> Basically, I think what the original poster asked about can be done,
> but they'll have to do most of it themselves.
>
> Frankly, one thing I'm a little unclear on, if a session is
> invalidated, either via a timeout or programmatically, is what will
> happen to next time getSession is called (with the create parameter
> set to false).  Will it return null, or will it return an invalidated
> session.  I'd think it'd return null, but then I'm not sure of why
> isRequestedSessionIdValid exists.  This makes a difference with regard
> to whether/how you can distinguish between someone who's new to the
> app and someone who was there before but who's session was invalidated.
>
>
> > e.g
> > <%
> > if(session.getAttribute("whatever")==null)
> > {
> > %>
> >     <jsp:forward page="some logout page.jsp"/>
> > <%}%>
> >
> > -----Original Message-----
> > From: Lior Shliechkorn [mailto:liorshliech@;yahoo.com]
> > Sent: Monday, October 21, 2002 1:40 PM
> > To: Tomcat
> > Subject: Session Time out - Tomcat
> >
> > When Tomcat times a session out, as instructed in the web.xml, is there a
> > way to capture that so a page can be displayed that the session has timed
> > out, or even prompt the user if he would like to continue being logged on?
> >
> > Thanks,
> >
> > Lior
>
> Milt Epstein
> Research Programmer
> Integration and Software Engineering (ISE)
> Campus Information Technologies and Educational Services (CITES)
> University of Illinois at Urbana-Champaign (UIUC)
> [EMAIL PROTECTED]
>
>
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-user-help@;jakarta.apache.org>
>

Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>

Reply via email to