`
froast
  • 浏览: 251892 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

struts2 OGNL取数据

阅读更多

昨天碰天这样一种情况,在extreme table中指定了一行,id为row,又想在ognl中取得该row中的字段属性.

发现可以这样写,<s:property value="#attr.row.id"/><s:property value="#attr.row.name"/>

其中id, name为row中的属性名,row是迭代中的一个Bean.

在struts2的OGNL中,数据放在以下几个地方:

(1)ValueStack:这是根路径(ROOT)

(2)request

(3)session

(4)application

(5)attr:当从attr中取数据时,会按page,request,session,application 的顺序进行遍历.通常不同的tag之间交换的数据都可以从attr中取到.

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics