struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ironic <>
Subject Struts2: list and map indexing
Date Fri, 27 Jul 2007 22:17:17 GMT

Can anyone point me to a working example of Struts2 indexed properties? I've
managed to get list indexing working: 
&lt;s:checkbox name="users[%{#status.index}].administrator"... /&gt;
but haven't had any luck with the map style: 
&lt;s:checkbox name="filter[%{}]"... /&gt;
(where state.getName returns a String), or the property-indexing style: 
&lt;s:textfield name="beanList(%{}).name" value="%{}"/&gt;
 (as described in the wiki
). I tried running something similar to the wiki example (see attached
code), but when I submit my form I see an exception thrown for every attempt
to set a property (see below). Any insight or pointers would be greatly

The top of the exception stack:

ERROR 17:31:23,510 [com.opensymphony.xwork2.util.XWorkMethodAccessor] - An
unexpected exception occurred
ognl.OgnlException: Error getting property descriptor: null
	at ognl.OgnlRuntime.callMethod(
	at ognl.OgnlRuntime.callMethod(
	at ognl.ASTMethod.getValueBody(
	at ognl.SimpleNode.evaluateGetValueBody(
	at ognl.SimpleNode.getValue(
	at ognl.ASTChain.setValueBody(
	at ognl.SimpleNode.evaluateSetValueBody(
	at ognl.SimpleNode.setValue(
	at ognl.Ognl.setValue(
	at com.opensymphony.xwork2.util.OgnlUtil.setValue(
... etc, etc

The relevant piece of my struts.xml file:

    &lt;action name="MyBean_show" method="show" class="MyBeanAction"&gt;
    &lt;action name="MyBean" class="MyBeanAction"&gt;
      &lt;result type="chain"&gt;MyBean_show&lt;/result&gt;

Here's the bean (as per wiki): 

Here's the action code: 

And the conversion properties: 
View this message in context:
Sent from the Struts - User mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message