<form method="POST" name="reluForm" action="<%=request.getContextPath() %>/charge?chaa=rule">
<p>业务:<select size="1" name="operation" onchange="javascript:checkList">
<option value="">---</option>
<%!
String a1[] = new String[10];
String a2[] = new String[10];
%>
<%
java.util.Iterator it = (Iterator)request.getAttribute("iteratorList");
int i =0;
while(it.hasNext()){
Charge ch = (Charge)it.next();
a1[i] = ch.getCharge_code();
a2[i] = ch.getOperation(); //数据库取出来的值,里面是有重复的,想通过数组的方式.
if(i>0)
{
if(!(a2[i].equals(a2[i-1]))){
%>
<option value="<%=a1[i] %>"><%=a2[i]%></option>
<%
}
}
i++;}
%>
</select></p>
数据库数据
FUNC_ID CHARGE_CODE FUNC_NAME
------- ----------- ----------
O A 开户
C B 其它
O B 开户
O C 开户
O D 开户
C A 其它
这样的数据就不是重复的了.