title: Session management in interceptors and action of struts 2 application
body: <p>I am having problem with session management in struts2. I am setting an attribute in the session in an interceptor which is the default interceptor for my entire application. In my action I am implementing SessionAware interface and grabbing the session as a Map. But the attribute which I set in the interceptor is not present in the session Map I have in my action. Did I miss in any default interceptor in my baseAppStack or any idea what I am missing?</p>
  
  <p>My intercepter definition in struts.xml:</p>
  
  <p>
     
     </p>
  
  <p>
      
      
     
    
    </p>
  
  <p>My intercepter code:</p>
  
  <blockquote>
  <pre><code>    HttpSession session =  request.getSession (true);
   params = (SessionParams)session.getAttribute(Constants.KEY_SESSION_PARAMS);
  </code></pre>
    
    <p>if (params == null) {</p>
  
  <pre><code>        //some code to populate params
  </code></pre>
    
    <p>session.setAttribute(Constants.KEY_SESSION_PARAMS, params);
            }</p>
  </blockquote>
  
  <p>My Action code:</p>
  
  <pre><code>Map session = getSession();
  SessionParams params = (SessionParams) session.get(Constants.KEY_SESSION_PARAMS);
  </code></pre>