You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Junhua gao <ju...@yahoo.com.cn> on 2009/04/01 12:48:56 UTC

The requested list key 'menuList' could not be resolved as a collection/array/map/

 who can please help me?
  
 select can not work.
  



jsp file

<s:select name="menuID"  list="menuList" listKey="menuID" listValue="menuName" id="menuSelectID"  size="12"/><br>

action file
private List	menuList	= new ArrayList<Map>();

	public void setMenuList(List menuList) {
		this.menuList = menuList;
	}

	public List getMenuList() {
		return this.menuList;
	}


public String execute() throws DefaultException {//get MenuList
   ......
  Map menuMap = new HashMap();
		
                   Collection menus = new ArrayList();
                   menus=...; 
                  Iterator it = menus.iterator();
		while (it.hasNext()) {
			vo = (MenuVO) it.next();
			menuMap = new HashMap();
			menuMap.put("menuID", vo.getMenuID());
			menuMap.put("menuName", vo.getMenuName());
			paymethodList.add(menuMap);
		}
		setMenuList(paymethodList);

}


 struts.xml
  <action name="MenusAction" class="com.qic.system.action.MenusAction">
    <result name="success">Menu.jsp</result>
    <result name="error">Menu.jsp</result>
 </action>  


      ___________________________________________________________ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org