Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在JSP中使用OGNL从集合中选择对象_Jsp_Iterator_Struts_Selection_Ognl - Fatal编程技术网

在JSP中使用OGNL从集合中选择对象

在JSP中使用OGNL从集合中选择对象,jsp,iterator,struts,selection,ognl,Jsp,Iterator,Struts,Selection,Ognl,我想从对象集合中选择一个对象 集合为attr.studyTypeListKey,其表达式正确,并保存在applicationContext中 选择条件是,集合中对象的code属性应等于study的值,study是迭代器中每个对象的属性 以下代码不起作用,即不显示任何内容: <s:property value="#attr.studyTypeListKey.{^#this.code == #study}.name" /> 下面将显示集合中的第一个对象,但该对象实际上不满足条件 <

我想从对象集合中选择一个对象

集合为attr.studyTypeListKey,其表达式正确,并保存在applicationContext中

选择条件是,集合中对象的code属性应等于study的值,study是迭代器中每个对象的属性

以下代码不起作用,即不显示任何内容:

<s:property value="#attr.studyTypeListKey.{^#this.code == #study}.name" />
下面将显示集合中的第一个对象,但该对象实际上不满足条件

<s:property value="#attr.studyTypeListKey.{?#this.code == #study}[0].name" />   
以下内容也不显示任何内容:

<s:property value="#attr.studyTypeListKey.{^#this.code == #study}.name" />