struts2中select标签

一、 action中:

private Map<String,String> map = new HashMap<String,String>(); public Map<String, String> getMap() { return map; } public void setMap(Map<String, String> map) { this.map = map; } public String execute() throws Exception { map.put("1", "高中"); map.put("2", "大学"); map.put("3", "硕士"); map.put("4", "博士"); return SUCCESS; }

jsp中:

<s:select name="test" id="test" list="map" headerKey="-1" headerValue="---请选择---" > </s:select>

或者:

<s:select name="sr.type" id="sr.type" listKey="key" listValue="value"

                list="#{1:'Call out',2:'Call in',3:'Mail out',4:getText('bizdevelop.msg.simplyrecord')}"/>

<s:radio  />标签同理!!!

<s:checkboxlist />标签同理!!!

即:<s:checkboxlist list="map" name="test1"></s:checkboxlist>

 

你可能感兴趣的:(exception,jsp,struts,String,list,action)