Map<String, String> mapGiftKbn = new HashMap<String, String>();
mapGiftKbn.put("KEY", "");
mapGiftKbn.put("VALUE", "");
mapGiftKbn = new HashMap<String, String>();
mapGiftKbn.put("KEY", "0");
mapGiftKbn.put("VALUE", "通常");
mapGiftKbn = new HashMap<String, String>();
mapGiftKbn.put("KEY", "1");mapGiftKbn.put("VALUE", "ギフト");
resultGiftKbn.add(mapGiftKbn);
bean.setLstGift_haisou_flg(resultGiftKbn);
/** --出荷指示ヘッダー.配送フラグ(ギフト)list */
private Vector<Map<String, String>> lstGift_haisou_flg = null;
前台JSP:
<TH>配送業者</TH>
<TD>
<SELECT NAME="trans_co_kbn" id="_trans_co_kbn">
<% resultSelect = new Vector<Map<String, String>>();
resultSelect = bean.getLstTrans_co_kbn();
for (int i = 0; i < resultSelect.size(); i++) {
Map<String, String> item = (Map<String, String>)resultSelect.get(i);
String key = StringUtil.nvl(item.get("KEY"));
String text = StringUtil.nvl(item.get("VALUE"));
if (key.equals(bean.getTrans_co_kbn())) {
%>
<option value="<%=key %>" selected><%=text %></option>
<% } else {%>
<option value="<%=key %>"><%=text %></option>
<% }
}
%>
</SELECT>
</TD>