Hi,
I'm trying to do something very similar. I have created a java.util.Map in a
struts action class and saved it in the request scope like so:
request.setAttribute("map", myMap);
Now I would like to access this map in a
java script located in my JSP. I can retrieve values by hardcoding the key like this:
testVar.value = "<bean:write name="map" property="test" />";
(key "test" is mapped to value "test successful")
However, I don't want to hardcode the key. I would like to do something like:
function myScript(field) {
var myKey = field.value;
testVar.value = "<bean:write name="map" property=myKey />";
}
There are obvious problems with trying to do this, but I'm having a hard time finding the solution. Any help would be greatly appreciated, and please let me know if more details are required.
-Brock