This is described in the documentation. Have a getter and a setter for your map in yhe action bean, and have input fields in the HTML form named like productVariantMap['foo']
(foo being a key of the map).
So for example, a form containing the following input fields will populate the map with 1 for the key "foo"
, and 2 for the key "bar"
:
<input type="text" name="productVariantMap['foo']" value="1"/>
<input type="text" name="productVariantMap['bar']" value="2"/>