I am trying to write a page that views and updates values from MBeans. My Action class has a method that exposes a Map of MBean client objects which mostly contain properties from the MBean. I am using the Preparable interface where the prepare() method populates the map. The view portion is working fine. All values including the checkbox, labels and text boxes are populating correctly. The problem is with the update portion of the functionality. I am expecting the params interceptor to make calls like getInboundBridges.get('key1').setMaxAttempts from the OGNL expression in the textbox name field of "inboundBridges['key1'].maxAttempts" when I submit my form. During the update form submission, the map already exists from the prepare() method but the setters are never called. I did have this working once using List instead of Map and was using the index of the List for the update. The problem with this approach is there is no guarantees that the List created in the prepare() method would be the same one between view and update, so the indexes may not match anymore. I tried to solve this by using the KeyProperty feature in a type convertor but could not get it working. I have then switched to the Map approach which is at least working on the view side. Any ideas why this is happening?
My action is defined like this: <package name="default" namespace="/" extends="struts-default"> <action name="ServiceSummary" class="serviceSummaryAction" method="execute"> <result>/serviceSummary.jsp</result> </action> <action name="UpdateServiceAction" class="serviceSummaryAction" method="update"> <result>/serviceSummary.jsp</result> </action> </package> The getter for the action class looks like this: public Map<String, MqMessageBridgeClient> getInboundBridges() { return this.inboundBridges; } The snippet from the JSP that deals with populating the view with a checkbox and a couple of textboxes looks like this: <s:form theme="simple" action="UpdateServiceAction" method="post"> ... <s:iterator value="inboundBridges.keys" status="stat" id="key"> <tr> <td align="center" nowrap="nowrap"> <s:checkbox theme="simple" name="inboundBridges['%{#key}'].active"/> </td> <td nowrap="nowrap"><s:property value="inboundBridges[#key].name"/> </td> <td nowrap="nowrap"><s:property value="inboundBridges[#key].location"/> </td> <td nowrap="nowrap"><s:property value="inboundBridges[#key].bridgeDescription"/> </td> <td nowrap="nowrap"><s:property value="inboundBridges[#key].initialState"/> </td> <td nowrap="nowrap"><s:property value="inboundBridges[#key].bridgeDestinationName"/> </td> <td nowrap="nowrap"><s:property value="inboundBridges[#key].connectionFactoryName"/> </td> <td nowrap="nowrap"><s:textfield name="inboundBridges['%{#key}'].maxAttempts" size="4"/></td> <td nowrap="nowrap"><s:textfield name="inboundBridges['%{#key}'].retryDelay" size="6"/></td> </tr> </s:iterator> ... <s:submit theme="simple" value="Update"/> </s:form> This is a snippet of the actual HTML source that is being rendered: <form id="UpdateServiceAction" name="UpdateServiceAction" onsubmit="return true;" action="/struts2.demo/UpdateServiceAction.action" method="post"> ... <input type="checkbox" name="inboundBridges['key1'].active" value="true" checked="checked" id="UpdateServiceAction_inboundBridges_'key1'__active"/> <input type="hidden" name="__checkbox_inboundBridges['key1'].active" value="true"/> </td> <td nowrap="nowrap">TestBridge </td> <td nowrap="nowrap">AdminServer </td> <td nowrap="nowrap">Test Bridge </td> <td nowrap="nowrap">MANAGED </td> <td nowrap="nowrap">aid.test.jms.mq.TestInboundMq </td> <td nowrap="nowrap">aid.ail.jms.connectionfactory.TestMqConnectionFactory&nb sp;</td> <td nowrap="nowrap"><input type="text" name="inboundBridges['key1'].maxAttempts" size="4" value="3" id="UpdateServiceAction_inboundBridges_'key1'__maxAttempts"/> </td> <td nowrap="nowrap"><input type="text" name="inboundBridges['key1'].retryDelay" size="6" value="5000" id="UpdateServiceAction_inboundBridges_'key1'__retryDelay"/> ... <input type="submit" id="UpdateServiceAction_1" value="Update"/> </form> Thanks for any help, Jeff