2 wudixiaowang wudixiaowang 于 2014.06.08 01:38 提问

struts2 装入包含检查是否登录的拦截器锥后,.jsp_Service()出现异常

我设置检查用户是否登录的包后,所有需要加载数据的页面出现是空白页面
2014-6-8 1:07:53 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.user.deleteuser_jsp._jspService(deleteuser_jsp.java:185)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at crm.filter.EncodingFilter.doFilter(EncodingFilter.java:17)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
struts.xml

<?xml version="1.0" encoding="GBK"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">

<!--指定Spring框架的自动装配模式 -->




/index.jsp
/error.jsp
/user/login.jsp




<!-- 设置该包的默认拦截器 -->








    <global-results>
          <result name="login" type="redirect">/user/login.jsp</result>
    </global-results>



    <action name="cancellation" class="crm.web.struts.action.CancellationAction">
          <result name="success" type="redirect">/user/login.jsp</result>
          <result name="error" type="redirect">/error.jsp</result>
    </action>
    <action name="charge" class="crm.web.struts.action.ChargeAction">
          <result name="success">/index.jsp</result>
          <result name="input" type="redirect">/pay/charge.jsp</result>
          <result name="error">/error.jsp</result>


    </action>
    <action name="payAction" class="crm.web.struts.action.PayAction">
          <result name="success">/index.jsp</result>
          <result name="input" type="redirect">/pay/pay.jsp</result>
          <result name="error">/error.jsp</result>

    </action>

deleteuserjsp页面


/s:action
<%ArrayList list=(ArrayList)request.getAttribute("list");
Iterator it=list.iterator();
int i=0;
Member m[]=new Member[5];
while(it.hasNext()){
m[i++]=(Member)it.next();
if(i==5){break;}
}
%>

/s:param
/s:url

/s:param
/s:url
 <div class="twelve columns header_nav">
尊敬的你好,退出
 <div class="row">

    <ul id="menu-header" class="nav-bar horizontal">

     <li class="active"><a href="../index.jsp">Home</a></li>

      <li class="has-flyout">
       <a href="#">会员信息管理</a><a href="#" class="flyout-toggle"></a>
        <ul class="flyout"><!-- Flyout Menu -->
          <li class="has-flyout"><a href="./adduser.jsp">会员信息增加</a></li>
          <li class="has-flyout"><a href="./deleteuser.jsp">会员信息删除</a></li>
          <li class="has-flyout"><a href="./alteruser.jsp">会员信息修改</a></li>
        </ul> 
      </li><!-- END Flyout Menu -->

      <li class="has-flyout">
       <a href="#">消息推送</a><a href="#" class="flyout-toggle"></a>
        <ul class="flyout"><!-- Flyout Menu -->
          <li class="has-flyout"><a href="../send/addsend.jsp">创建推送</a></li>
          <li class="has-flyout"><a href="../send/deletesend.jsp">删除推送</a></li>

        </ul> 
      </li>
      <li class="has-flyout">
       <a href="#">权限管理</a><a href="#" class="flyout-toggle"></a>
        <ul class="flyout"><!-- Flyout Menu -->
          <li class="has-flyout"><a href="../worker/addworker.jsp">增加收用户</a></li>
          <li class="has-flyout"><a href="../worker/deleteworker.jsp">删除用户</a></li>

        </ul> 
      </li>
       <li class="has-flyout">
       <a href="#">充值缴费</a><a href="#" class="flyout-toggle"></a>
        <ul class="flyout"><!-- Flyout Menu -->
          <li class="has-flyout"><a href="../pay/charge.jsp">充值</a></li>
          <li class="has-flyout"><a href="../pay/pay.jsp">缴费</a></li>

        </ul> 
      </li>

    </ul>

    <script type="text/javascript">
     //<![CDATA[
     $('ul#menu-header').nav-bar();
      //]]>
    </script>

  </div>  
  </div>

    <div class="row"><form method="post" action="">
编号 会员名 卡号 余额
1
2
3
4
5
会员名
卡号
    </div></div>

</section>

1个回答

andan14
andan14   2014.06.11 22:18

代码拷贝太乱,不知所云,没有看见你配置的拦截器

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!