首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

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

2011-11-30 
struts2 s:if testsstring in ${listValue} Action中指定数据private ListString s new ArrayL

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写的有什么问题吗?
谢谢

[解决办法]
接分了

热点排行