1.struts2中的Action封装数据的方式

方式1

【Struts2框架】Struts2中的Action封装数据

方式2

页面

【Struts2框架】Struts2中的Action封装数据

Action类

【Struts2框架】Struts2中的Action封装数据

方法3

【Struts2框架】Struts2中的Action封装数据

2.在Action中如何控制作用域对象(request,session,application)

方式一:使用代码的方式获取经过struts2重新封装过(struts2把HttpServletRequest/HttpSession/ServletContext接口重新封装成Map对象)

【Struts2框架】Struts2中的Action封装数据

方法二:

 

【Struts2框架】Struts2中的Action封装数据

方法二:使用原生的作用域对象(HttpServletRequest/HttpSession/ServletContext接口)

【Struts2框架】Struts2中的Action封装数据

3.只负责跳转页面而不需要业务处理的Action的编写

【Struts2框架】Struts2中的Action封装数据

 

相关文章: