How to pass parameter to method call in Struts 2 OGNL

三世轮回 提交于 2019-12-05 22:47:08

问题


I want to use a property as a param of an object's method.

<s:property value="orderProductId" />

returns correct value (e.g. 1)

<s:iterator value="%{order.getProductById(1).activations}">

gives me correct value too. But

<s:iterator value="%{order.getProductById(#orderProductId).activations}">

doesn't. Not sure why #orderProductId doesn't interpret correctly.


回答1:


Ah, the joy of %#$ in OGNL... This doesn't work ?

<s:iterator value="%{order.getProductById(orderProductId).activations}">


来源:https://stackoverflow.com/questions/2945684/how-to-pass-parameter-to-method-call-in-struts-2-ognl

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