我想根据数据库结果设置多个选项
<tr>
<td>Roles :</td>
<td>
<select id="role" name="role" multiple>
<%
while(rs2.next()){
String role = rs2.getString("role_name");
if(role.equalsIgnoreCase("role1")){
role1= true;
}
else if(role.equalsIgnoreCase("role2")){
role2 = true;
}
else if(role.equalsIgnoreCase("role3")){
role3= true;
}
else if(role.equalsIgnoreCase("role4")){
role4= true;
}
}
%>
<option value="role1">role1</option>
<option value="role2">role2</option>
<option value="role3">role3</option>
<option value="role4">role4</option>
</select>
</td>
</tr>