I've got the following (shortened) struts2 action:
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<String, String> cookiesMap;
@Override
public void setCookiesMap(Map<String, String> cookiesMap) {
this.cookiesMap = cookiesMap;
}
}
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 should be getting called - have i missed something here?
Thanks