iterator标签的var存储在Stack Context中,为什么不使用#也能访问到。

byyoung 2011-07-14 09:30:34
<s:iterator value="{'aaa', 'bbb', 'ccc'}" var="x">
<s:property value="#x.toUpperCase()"/> |
</s:iterator>

中变量x是Stack Context中的内容,为什么不通过#也能访问到?


<s:iterator value="{'aaa', 'bbb', 'ccc'}" var="x">
<s:property value="x"/> |
</s:iterator>

但是这里不能用toUpperCase()了。
...全文
147 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
liudajiang 2014-04-02
  • 打赏
  • 举报
回复
OGNL取值时,如果没有加”#“,则在ValueStack中查找, 如果没有找到,会去ActionContext的map中查找,如果找到会强转成String返回。
bianhei000 2011-07-14
  • 打赏
  • 举报
回复
貌似迭代会把当前对象放在ValueStack的栈顶中 加上var=“x”的话,会在actionContext那个map里也放一份key是x 值是当前迭代对象的东东,这样就有两份了,所以加#和不加都能访问到值,至于那个转大写的方法就不知道怎么回事了

不知道是不是该这么解释
byyoung 2011-07-14
  • 打赏
  • 举报
回复
谢谢上面几位。

难道没有一个有针对性的回答吗?

这里不是应用问题,而是纯理论研究。

希望有人能够解答,谢谢。
zl3450341 2011-07-14
  • 打赏
  • 举报
回复
本人不太喜欢用struts2的标签。 看下struts2的源码,他对request,response对象都进行了包装,以完成传值,值堆栈.

介意标签还是用JSTL
xjmlj2010 2011-07-14
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 jianglang_a 的回复:]
x.toUpperCase
[/Quote]
...
亲努力啊 2011-07-14
  • 打赏
  • 举报
回复
x.toUpperCase
Twitter Digg Facebook Del.icio.us Reddit Stumbleupon Newsvine Technorati Mr. Wong Yahoo! Google Windows Live Send as Email Add to your CodeProject bookmarks Discuss this article 85 Print Article Database » Database » Other databasesLicence CPOL First Posted 19 Jan 2012 Views 24,219 Downloads 992 Bookmarked 74 times RaptorDB - The Key Value Store V2 By Mehdi Gholam | 8 Mar 2012 | Unedited contribution C#.NETDBABeginnerIntermediateAdvanceddatabase Even faster Key/Value store nosql embedded database engine utilizing the new MGIndex data structure with MurMur2 Hashing and WAH Bitmap indexes for duplicates. See Also More like this More by this author Article Browse Code Stats Revisions (8) Alternatives 4.95 (56 votes) 1 2 3 4 5 4.95/5 - 56 votes μ 4.95, σa 1.05 [?] Is your email address OK? You are signed up for our newsletters but your email address is either unconfirmed, or has not been reconfirmed in a long time. Please click here to have a confirmation email sent so we can confirm your email address and start sending you newsletters again. Alternatively, you can update your subscriptions. Add your own alternative version Introduction What is RaptorDB? Features Why another data structure? The problem with a b+tree Requirements of a good index structure The MGIndex Page Splits Interesting side effects of MGIndex The road not taken / the road taken and doubled back! Performance Tests Comparing B+tree and MGIndex Really big data sets! Index parameter tuning Performance Tests - v2.3 Using the Code Differences to v1 Using RaptorDBString and RaptorDBGuid Global parameters RaptorDB interface Non-clean shutdowns Removing Keys Unit tests File Formats File Format : *.mgdat File Format : *.mgbmp File Format : *.mgidx File Format : *.mgbmr , *.mgrec History Download RaptorDB_v2.0.zip - 38.7 KB Download RaptorDB_v2.1.zip - 39 KB Download RaptorDB_v2.2.zip - 39 KB Download RaptorDB_v2.3.zip - 39.6 KB D

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧