的使用

java:
Vector v= new Vector();
v.add(new LabelValueBean("value0", "key0"));
v.add(new LabelValueBean("value1", "key1"));
v.add(new LabelValueBean("value2", "key2"));
request.getSession().setAttribute("list",v);


html:
<jsp:useBean id="list" scope="session" class="java.util.Vector" />

<% if (list.size() == 1) { %>
<input type="text" name="type" readonly="readonly" value=<%=((org.apache.struts.util.LabelValueBean) list.get(0)).getLabel()%> />
<%} else {%>
<html:select property="type" styleClass="select1">
    <html:options collection="list" property="value" labelProperty="label" />
</html:select>
<%}%>

你可能感兴趣的:(java,html,jsp)