程序运行数据量大速度慢,于是想做个loading页,配置了execAndWait这个拦截器之后,此Action下的所有方法都变成了空指针,请问为什么会这样,如何解决?具体如下:<action name="everydayStatisticsAction" class="everydayStatisticsAction">
            <interceptor-ref name="execAndWait">
            <param name="includeMethods">duanxin</param>
            </interceptor-ref>
         <result name="userStatistics">/statistics/everyday/userStatistic.jsp</result>
            <result name="mapStatistics">/statistics/everyday/duanxinStatistic.jsp</result>
            <result name="wait">/statistics/everyday/wait.jsp</result>
</action>wait.jsp中加入了<meta http-equiv="refresh" content="10;url=<s:url includeParams='all'/>" />Action中实现了接口SessionAware,如
protected Map<String, Object> session;
public void setSession(Map<String, Object> session) {
this.session = session;
}  
大家快来帮帮我额,为什么会这样呢,咋解决额

解决方案 »

  1.   

    我像你说的做了  还是不行
    到ActionContext.getContext().put(K, V);
    这就空指针HttpServletRequest request.setAttribute也是空指针
      

  2.   

    1.继承SessionAware借口,实现其方法
    2.需要request的地方用ServletContext context代替,如:context.setAttribute("listSms", listSms);
    3.需要getParameter的地方可以用struts2 Action中对象与页面交互的特性,进行取值