struts2 action里ActionContext.getContext().getSession() 报空异常

在struts2action里ActionContext.getContext().getSession() 总是报空异常 ------解决方法----------------

在struts2action里ActionContext.getContext().getSession() 总是报空异常

------解决方法--------------------------------------------------------
ActionContext ac = ActionContext.getContext();
ac.getSession();
------解决方法--------------------------------------------------------
ServletActionContext.getRequest().getSession();