日期:2014-05-17  浏览次数:20671 次

SSH在很长时间不操作,再操作的时候报错
我怀疑是session失效的问题,但是如果是,那怎么改成如果失效的话,再操作就自动跳到登陆页面呢??


HTTP Status 500 - 


--------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: java.lang.NullPointerException

  org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:500)

  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:428)

  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

  org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)

  org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)

  org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)

  org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)

  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)

  javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

  dao.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:25)

root cause 

java.lang.NullPointerException

  org.apache.jsp.question.questionlist_jsp._jspService(questionlist_jsp.java:149)

  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)

  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

  org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)

  org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)

  org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)

  org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)

  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)

  javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

  dao.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:25)


------解决方案--------------------
加个过滤器,进行session认证,就可以了
http://blog.163.com/wen_qg/blog/static/5320191920073895356169/
------解决方案--------------------
if(session.getAttribute("xxx") == null) response.sendRedirect("login.j