title: Using cookies with Struts 2 and Struts
body: <p>I've got the following (shortened) struts2 action:</p>
  
  <pre><code>public class MyAction extends BaseAction implements CookiesAware {
  
    public String execute() {
  
      if (cookiesMap.containsKey("BLAH"))
        blah=Integer.parseInt(cookiesMap.get("BLAH"));
  
        return "success";
    }
  
    // For handling cookies
    Map&lt;String, String&gt; cookiesMap;
    @Override
    public void setCookiesMap(Map&lt;String, String&gt; cookiesMap) {
      this.cookiesMap = cookiesMap;
    }
  }
  </code></pre>
  
  <p>I get a null pointer exception when i do 'cookiesMap.containsKey' - it seems to me that setCookiesMap isn't being called. I've implemented the CookiesAware interface so i would have thought that it <em>should</em> be getting called - have i missed something here?</p>
  
  <p>Thanks</p>