am具有以下jsp標記以顯示數組列表值,zoneInformation
包含[North, South, East, West]
。如何在jsp中爲dropdownlist設置值?
<html:form action="addcountry">
<%@ page import="java.util.List"%>
<%@ page import="java.util.ArrayList"%>
<html:select property="zone" styleClass="text ui-widget-content ui-corner-all">
<% ArrayList ls = (ArrayList)request.getAttribute("zoneInformation");
for(int i=0;i<ls.size();i++){
%>
<html:option value=" "><%=ls.get(i)%></html:option>
<%}%>
</html:select>
</html:form>
如何爲此下拉列表設置值....?
JSTL簡直太神奇了....!和mycode工作正常!感謝您的幫助! :-) – Manivannan