Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

After Max Inactive.. 1

Status
Not open for further replies.

neltan

Programmer
Nov 4, 2002
82
AU
Don't know why.
After max inactive time, the valid_user.jsp can't redirect.
I'm sure that it is cause by response.sendredirect(), what's wrong with that?

============================================================
These are the error
============================================================java.lang.NullPointerException
at org.apache.jsp.rc_insert_jsp._jspService(rc_insert_jsp.java:207)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

============================================================
Here is my source
============================================================
// login_session.jsp
session.setMaxInactiveInterval(900); // = 15 min

// valid_user
<%@ page import=&quot;settings.*, bean.*&quot;%>
if(session.getValue(&quot;username&quot;) == null){
response.sendRedirect(&quot;/jsp/index.jsp&quot;);
}

 
No I don't think so :).
Your session becomes null after the time out.Then you are trying to get the value &quot;username&quot; from your session.
Try this
// login_session.jsp
session.setMaxInactiveInterval(900); // = 15 min

// valid_user
<%@ page import=&quot;settings.*, bean.*&quot;%>
if(session == null){
response.sendRedirect(&quot;/jsp/index.jsp&quot;);
}




Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top