title: How to access action class session in another action class
body: <p>How to access one action class session in another action class in Struts2?</p>
  
  <pre class="lang-java prettyprint-override"><code>public String execute()
  {
      HttpServletRequest request=ServletActionContext.getRequest();  
      HttpSession session=request.getSession();  
      //System.out.println(" table  "+tid);
      //Map session = ActionContext.getContext().getSession();
  
      Map&lt;String,Integer&gt; s =(Map)session.getAttribute("table"+tid);  
      if(s!=null)
      {
          System.out.println("in if");
      for (Map.Entry&lt;String,Integer&gt; en : s.entrySet()) 
      {
              System.out.println(" in tableactio ");
      }
  </code></pre>