为了访问HttpSession实例,Struts 2提供了一个ActionContext类,该类提供了一个getSession()方法,但是
该方法的返回值并不是HttpSession,而是Map。这又是为什么?
实际上,这与Struts 2的设计哲学有关,Struts 2为了简化Action类的测试,将Action类与Servlet API完全分离,
所以返回的是Map类型,而不是HttpSession。
虽然ActionContext类的getSession()方法的返回值类型不是HttpSession对象,而是Map对象,但是Struts 2的
系列拦截会负责该Map对象和HttpSession对象之间的转换。