求教高手 struts2 问题
Action类中有
private static HashMap<String,String> responsibleObjectType = new HashMap<String, String>();
responsibleObjectType 都有get和set 方法
我把 responsibleObjectType 在页面中有下面的方法显示
ognl 静态Map属性
<s:select list="@Action@responsibleObjectType" headerKey="请选择" headerValue="0" name="targetObject.targetRange"></s:select>
这样老是报错
tag 'select', field 'list', name 'targetObject.targetRange': The requested list key '@@responsibleObjectType' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]
------解决方案--------------------把map打印看下 看格式对不对,
也有可能是页面上没得到map
我的做法是封装到list
然后<s:bean name="com.xxx" id="youId"></s:bean>
<s:select list="#youId.property" name="degreaseType" listKey="_key" listValue="_name"/>
------解决方案--------------------<s:select list="#responsibleObjectType" headerKey="请选择" headerValue="0" name="targetObject.targetRange"> </s:select>
修改成这样看看
------解决方案--------------------@Action你修改为你的action的全类名看看
例如:@net.csdn.actions.TestAction@responsibleObjectType
------解决方案--------------------'@@responsibleObjectType' action 的路径错了,你仔细检查一下.