You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Igor Vlasov <vi...@mail.ru> on 2007/10/10 14:33:28 UTC

NULL Session object after execAndWait interceptor

I found a strange behaviour in action after execAndWait interceptor.

I have 

1.  <action name="doSearch" class="s2.action.SearchAction"  >
      <interceptor-ref name="basicStack"/>
      <interceptor-ref name="execAndWait">
        2000
        500 
      </interceptor-ref>
      <result  name="wait">wait_search.jsp</result>
     
      <result  name="success" type="redirect"  >search_result.jsp</result>
    </action>

2. s2.action.SearchAction:

public class SearchAction  extends ActionSupport implements
ServletRequestAware {
  protected HttpServletRequest request;
  private HttpSession sess;
  public String execute() throws Exception{
   /*I*/ sess = request.getSession();// not NULL !!!!!
    try {
      // выполняется поиск и опрос всех поставщиков в пультипотоковом режиме
      Thread.currentThread().sleep(6*1000);
      
    } catch (InterruptedException ex) {
      _log.error("Long search action",ex);
    }
    
   /*II*/  sess = request.getSession(); // !!! is NULL !!!!!
    storeSearchParameters();
    return this.SUCCESS;
  }
 public void setServletRequest(HttpServletRequest httpServletRequest) {
    request = httpServletRequest;
    
  }
  
  
}
I spend 3 hours before guess to move from "II" to "I" :-(
-- 
View this message in context: http://www.nabble.com/NULL-Session-object-after-execAndWait-interceptor-tf4600442.html#a13134712
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org