The below js code does not set the value to hashmap.
POJO:
private HashMap myMap = new HashMap();
public String getHashmapField(String key) {
return (String) myMap.get(key);
}
public void setHashmapField(String key, String val) {
myMap.put(key, val);
}
jsp field:
<input type="hidden" id="hashmapField(lastname)" name="hashmapField(lastname)" />
js code:
document.getElementById("hashmapField(lastname)").value = "XYZ";
As far as I remember you should use special tags to set values.
https://struts.apache.org/tag-developers/hidden-tag.html
in this case:
<s:hidden name="foo" value="%{hashmapField}" />
I don't know how you set the object that has hashmapField so I can't say if it needs to be prefixed but check the documentation and see if this is what you need.
The code that you have, unless things have changed a lot, doesn't actually use any properties from the server. At the very least I would expect %{...}