Struts 2应用程序中有多少个范围?如果我们在那里使用会话和请求范围是否好?行动范围如何适用于会议并请求两者?
答案 0 :(得分:1)
Struts 2正在运行一个容器,它有bean的范围。有关bean范围的更多信息,请参阅this问题。所有其他范围都是servlet范围。 Struts使用它自己的结构使用间接访问这些范围。例如,set
标记使用以下范围:
可用范围如下:
application - the value will be set in application scope according to servlet spec. using the name as its key session - the value will be set in session scope according to servlet spec. using the name as key request - the value will be set in request scope according to servlet spec. using the name as key page - the value will be set in page scope according to servlet sepc. using the name as key action - the value will be set in the request scope and Struts' action context using the name as key
注:
如果未指定范围,则默认为操作范围。