当前位置: 代码迷 >> J2EE >> struts2 <s:if test="'sstring' in ${listValue}" >
  详细解决方案

struts2 <s:if test="'sstring' in ${listValue}" >

热度:628   发布时间:2016-04-22 03:24:44.0
struts2 <s:if test="'sstring' in ${listValue}" >
Action中指定数据
private List<String> s = new ArrayList<String>();
s.add("mead");
s.add("lai");
s.add("amy");
页面中:
<s:if test="'mead' in ${s}" >
It is true,
</s:if>
<s:else>
It is false,
</s:else>
上面输出的是It is false,
-----------------------------

如果页面中写成
<s:if test="'mead' in {'mead','amy','lai'}" >
It is true,
</s:if>
<s:else>
It is false,
</s:else>
这样就输出的是It is true,

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
请问我的ognl写的有什么问题吗?
谢谢

------解决方案--------------------
接分了
  相关解决方案