How to use OGNL index reference operator

半腔热情 提交于 2019-12-02 08:03:33
Aleksandr M

In the given expression <s:property value="#attr[#foo]"/> the part inside [] will be evaluated first. The #foo is resolved to bar so expression becomes #attr['bar'] (which is equivalent to #attr.bar).

Using #attr.bar the value for bar will be searched until it is found in the page context, then in the request, then in the session and then in the application scope.

The #context.bar gets value from OGNL context value map with key bar.

The #request.bar tries to get request attribute with name bar from the request map and if it isn't found then bar will be searched in the value stack. This happens in Struts2 request wrapper implementation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!