This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Get the modified value from ArrayList of HashMap.

 
Lan Ama
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am displaying an ArrayList of HashMap in JSP using logic:iterate.

action form (MyForm)
===========
private ArrayList myList = new ArrayList();


public ArrayList getMyList() {
  return myList;
}
public void setMyList(ArrayList myList) {
  this.myList = myList;
}

initial action
==============
ArrayList list = new ArrayList()
Map map = new HashMap()
map.put("ONE","OneOne")
map.put("TWO","OneTwo")
list.add(map);
map = new HashMap()
map.put("ONE","TwoOne")
map.put("TWO","TwoTwo")
list.add(map);
myForm.setMyList(list)

JSP (i replace "<>" with "[]")
===



The display is OK as it shows all the contents of the list.

[OneOne] [OneTwo]
[TwoOne] [TwoTwo]

My problem is that if i modify the contents... for example i modified it as:
[A] [B]
[C] [D]

then click a submit button, the changes are not reflected in the Action.

Please advise. Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic