tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From teh j <tomcat_list2...@yahoo.com.au>
Subject session.setMAxInactiveInterval()
Date Thu, 10 May 2001 23:34:43 GMT
Hello there 

I was wondering if anybody could help me out with a
problem regarding sessions? I have a jsp app that is
protected by storing a user login in the session
object. The session object is checked to see that the
user is logged in everytime the user accesses a
protected page. If the user tries to go directly to a
protected page's url, they are redirected because the
page checks the session variable and finds that the
session variable is null., The code that does this is;


<% 
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");


} 
%> 

I have however, set the session.setMaxInactiveInterval
to a period of time to log the user out automatically
after a period of time for security reasons. But after
the session has expired, instead of being redirected
to the not_logged_in.html page, I get the error
message below; 

The word 'here' in the line 'This document has moved
here' is a link to no_logged_in.html 

Can anybody help? Des session.setMaxInactiveInterval
not set all session variables to null? 

****ERROR MSG STARTS HERE***** 
Document moved 
This document has moved here. 

Error: 500 
Location: /test/jason/archive/archive.jsp 
Internal Servlet Error: 

javax.servlet.ServletException 
at 
org.apache.jasper.runtime.PageContextImpl.handlePageException
(PageContextImpl.java:459) 
at 
jason.archive._0002fjason_0002farchive_0002farchive_0002ejsparchi
ve_jsp_6._jspService 
(_0002fjason_0002farchive_0002farchive_0002ejsparchive_jsp_6.java

:509) 
at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:119) 
at javax.servlet.http.HttpServlet.service 
(HttpServlet.java:853) 
at 
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
(JspServlet.java:177) 
at org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:318) 
at org.apache.jasper.servlet.JspServlet.service
(JspServlet.java:391) 
at javax.servlet.http.HttpServlet.service 
(HttpServlet.java:853) 
at org.apache.tomcat.core.ServletWrapper.doService
(ServletWrapper.java:404) 
at org.apache.tomcat.core.Handler.service 
(Handler.java:286) 
at org.apache.tomcat.core.ServletWrapper.service
(ServletWrapper.java:372) 
at
org.apache.tomcat.core.ContextManager.internalService
(ContextManager.java:797) 
at org.apache.tomcat.core.ContextManager.service
(ContextManager.java:743) 
at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConne
ction(HttpConnectionHandler.java:210) 
at org.apache.tomcat.service.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:416) 
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run
(ThreadPool.java:498) 
at java.lang.Thread.run(Thread.java:484) 

Root cause: 
java.lang.NullPointerException 
at
mainPage.eventsOnday.processQuery(eventsOnday.java:78)

at 
jason.archive._0002fjason_0002farchive_0002farchive_0002ejsparchi
ve_jsp_6._jspService 
(_0002fjason_0002farchive_0002farchive_0002ejsparchive_jsp_6.java

:154) 
at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:119) 
at javax.servlet.http.HttpServlet.service 
(HttpServlet.java:853) 
at 
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
(JspServlet.java:177) 
at org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:318) 
at org.apache.jasper.servlet.JspServlet.service
(JspServlet.java:391) 
at javax.servlet.http.HttpServlet.service 
(HttpServlet.java:853) 
at org.apache.tomcat.core.ServletWrapper.doService
(ServletWrapper.java:404) 
at org.apache.tomcat.core.Handler.service 
(Handler.java:286) 
at org.apache.tomcat.core.ServletWrapper.service
(ServletWrapper.java:372) 
at
org.apache.tomcat.core.ContextManager.internalService
(ContextManager.java:797) 
at org.apache.tomcat.core.ContextManager.service
(ContextManager.java:743) 
at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConne
ction(HttpConnectionHandler.java:210) 
at org.apache.tomcat.service.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:416) 
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run
(ThreadPool.java:498) 
at java.lang.Thread.run(Thread.java:484) 
Hello there 

I was wondering if anybody could help me out with a
problem regarding sessions? I have a jsp app that is
protected by storing a user login in the session
object. The session object is checked to see that the
user is logged in everytime the user accesses a
protected page. If the user tries to go directly to a
protected page's url, they are redirected because the
page checks the session variable and finds that the
session variable is null., The code that does this is;


<% 
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");


} 
%> 

I have however, set the session.setMaxInactiveInterval
to a period of time to log the user out automatically
after a period of time for security reasons. But after
the session has expired, instead of being redirected
to the not_logged_in.html page, I get the error
message below; 

The word 'here' in the line 'This document has moved
here' is a link to no_logged_in.html 

Can anybody help? Des session.setMaxInactiveInterval
not set all session variables to null? 

****ERROR MSG STARTS HERE***** 
Document moved 
This document has moved here. 

Error: 500 
Location: /test/jason/archive/archive.jsp 
Internal Servlet Error: 

javax.servlet.ServletException 
at 
org.apache.jasper.runtime.PageContextImpl.handlePageException
(PageContextImpl.java:459) 
at 
jason.archive._0002fjason_0002farchive_0002farchive_0002ejsparchi
ve_jsp_6._jspService 
(_0002fjason_0002farchive_0002farchive_0002ejsparchive_jsp_6.java

:509) 
at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:119) 
at javax.servlet.http.HttpServlet.service 
(HttpServlet.java:853) 
at 
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
(JspServlet.java:177) 
at org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:318) 
at org.apache.jasper.servlet.JspServlet.service
(JspServlet.java:391) 
at javax.servlet.http.HttpServlet.service 
(HttpServlet.java:853) 
at org.apache.tomcat.core.ServletWrapper.doService
(ServletWrapper.java:404) 
at org.apache.tomcat.core.Handler.service 
(Handler.java:286) 
at org.apache.tomcat.core.ServletWrapper.service
(ServletWrapper.java:372) 
at
org.apache.tomcat.core.ContextManager.internalService
(ContextManager.java:797) 
at org.apache.tomcat.core.ContextManager.service
(ContextManager.java:743) 
at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConne
ction(HttpConnectionHandler.java:210) 
at org.apache.tomcat.service.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:416) 
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run
(ThreadPool.java:498) 
at java.lang.Thread.run(Thread.java:484) 

Root cause: 
java.lang.NullPointerException 
at
mainPage.eventsOnday.processQuery(eventsOnday.java:78)

at 
jason.archive._0002fjason_0002farchive_0002farchive_0002ejsparchi
ve_jsp_6._jspService 
(_0002fjason_0002farchive_0002farchive_0002ejsparchive_jsp_6.java

:154) 
at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:119) 
at javax.servlet.http.HttpServlet.service 
(HttpServlet.java:853) 
at 
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
(JspServlet.java:177) 
at org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:318) 
at org.apache.jasper.servlet.JspServlet.service
(JspServlet.java:391) 
at javax.servlet.http.HttpServlet.service 
(HttpServlet.java:853) 
at org.apache.tomcat.core.ServletWrapper.doService
(ServletWrapper.java:404) 
at org.apache.tomcat.core.Handler.service 
(Handler.java:286) 
at org.apache.tomcat.core.ServletWrapper.service
(ServletWrapper.java:372) 
at
org.apache.tomcat.core.ContextManager.internalService
(ContextManager.java:797) 
at org.apache.tomcat.core.ContextManager.service
(ContextManager.java:743) 
at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConne
ction(HttpConnectionHandler.java:210) 
at org.apache.tomcat.service.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:416) 
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run
(ThreadPool.java:498) 
at java.lang.Thread.run(Thread.java:484) 


_____________________________________________________________________________
http://messenger.yahoo.com.au - Yahoo! Messenger
- Voice chat, mail alerts, stock quotes and favourite news and lots more!

Mime
View raw message