Sep 22, 2004 #1 rajpuri Programmer Joined Apr 17, 2002 Messages 4 Location US Dear Friends how to put the http requests in a hashmap and access the hashmap using the struts. a small code example would be helpful. Thank u.. pls kindly respond me ASAP. raj
Dear Friends how to put the http requests in a hashmap and access the hashmap using the struts. a small code example would be helpful. Thank u.. pls kindly respond me ASAP. raj
Sep 23, 2004 #2 byam Programmer Joined Oct 24, 2003 Messages 396 Location CA Do you mean the other way round, putting a Hashmap into request object, and retrieve it later in the process? if so you put a HashMap to request object: Code: HashMap map = new HashMap(); map.put("1", "string 1"); request.setAttribute("yourMap", map); You can than iterate the map by: Code: <logic:iterate id="element" name="yourMap"> Next element is <bean:write name="element" property="value"/> </logic:iterate> Upvote 0 Downvote
Do you mean the other way round, putting a Hashmap into request object, and retrieve it later in the process? if so you put a HashMap to request object: Code: HashMap map = new HashMap(); map.put("1", "string 1"); request.setAttribute("yourMap", map); You can than iterate the map by: Code: <logic:iterate id="element" name="yourMap"> Next element is <bean:write name="element" property="value"/> </logic:iterate>