dcsimg
Logic:iterate over a bean
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Friday, September 17, 2004 12:10 AM

I have a bean: package books; import java.util.Map; import java.util.HashMap; public class CommonBean { private Map values = new HashMap(); public void setValue(String key, Object value) { values.put(key, value); } public Object getValue(String key) { return values.get(key); } } In the Action class I populate this bean with ArrayList aCommonBean = new CommonBean(); ArrayList list1 = new ArrayList(); list1.add("apple"); list1.add("grapes"); aSCCommonBean.setValue("list1", list1); ArrayList list2 = new ArrayList(); list2.add(&qu   More>>

I have a bean:

			
package books;
import java.util.Map;
import java.util.HashMap;

public class CommonBean {
private Map values = new HashMap();
public void setValue(String key, Object value) {
values.put(key, value);
}
public Object getValue(String key) {
return values.get(key);
}

}


In the Action class I populate this bean with ArrayList

			
aCommonBean = new CommonBean();
ArrayList list1 = new ArrayList();
list1.add("apple");
list1.add("grapes");
aSCCommonBean.setValue("list1", list1);
ArrayList list2 = new ArrayList();
list2.add("cofee");
list2.add("tea");
hm.put("list2",list2);
aCommonBean.setValue("list2", list2);

In the JSP page I trying to show these values of arraylist as:

			







But no siccess..does anybody have any idea?

   <<Less

Re: Logic:iterate over a bean

Posted By:   Frank_Hu  
Posted On:   Saturday, September 18, 2004 02:25 AM

About | Sitemap | Contact