File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes hash map getting null or only last value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "hash map getting null or only last value" Watch "hash map getting null or only last value" New topic
Author

hash map getting null or only last value

arjun rampal
Ranch Hand

Joined: Jul 08, 2005
Posts: 125
Hi I am getting only last value from hashmap
codes are below.

Then I used iterator and getting
Required string is null or empty



jsp code

<bean efine id="a" name="b" property="c"/>
<bean efine id="e" name="b" property="d"/>
<%
java.util.HashMap params = new java.util.HashMap();
params.put("a",a);
params.put("b",e);
session.setAttribute("paramsName", params);
%>



action classs code
Map paramsName = new HashMap();


paramsName=(HashMap)session.getAttribute("paramsName");
if (paramsName!=null)
{Iterator pIter = paramsName.keySet().iterator();
while(pIter.hasNext()){
a=(String)pIter.next();}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hash map getting null or only last value
 
Similar Threads
passing bean:param and input parm
Struts html:link problem
jsp standard actions or tags instead of scriplet
geting only l;ast vale from hashmap
pageContext problem