[EMAIL PROTECTED] (=?iso-8859-1?q?teh=20j?=) writes:
> <%
> String user_id = (String)session.getAttribute("user_id");
> String user_level = (String)session.getAttribute("user_level");
>
> if (user_id==null) {
> /*
> *User is not logged in! Redirect
> */
> response.sendRedirect("../security/not_logged_in.html");
> }
> %>
[...]
> Root cause:
> java.lang.NullPointerException
> at
> mainPage.eventsOnday.processQuery(eventsOnday.java:78)
I believe that your problem is not to do with the session expiring,
but that the rest of your JSP attempts to execute after you have sent
the redirection. If this code uses "user_id" or "user_level" then you
will get a NullPointerException.
Change the check to be:
if (user_id==null) {
response.sendRedirect("../security/not_logged_in.html");
return;
}
I am using the same approach for ensuring that users are logged in,
and I get no problem when sessions expire.
--
`O O' | [EMAIL PROTECTED]
// ^ \\ | http://www.pyrites.org.uk/