What about iterating the map and put each attribute in the HttpRequest.
Something like this:
Map<String, Object> myMap = getMyMap();
Set<Map.Entry<String, Object>> entrySet = myMap.entrySet();
for (Map.Entry<String, Object> entry : myMap.entrySet()) {
request.setAttribute(entry.getKey(), entry.getValue());
}
Alfredo Osorio
-----Mensaje original-----
De: Dave Evans [mailto:[email protected]]
Enviado el: Wednesday, January 19, 2011 4:21 PM
Para: Struts Users Mailing List
Asunto: Add a map to HttpRequest attributes
Hello,
I have a business layer method that returns a map of objects. I would
like to put all of the keys and values of this map into the request
attribute map, like this:
HttpRequest.putAll(map);
This of course doesn't work, as the request isn't a map and the
attributes map isn't available as a map.
Are there any Struts or Apache commons utils that will do this?
Thanks,
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]