Query in data population using select in jsp
I am populat开发者_JAVA百科ing data using
<select name="test">
<option value='<%=session.getAttribute("tList")%>'><%=session.getAttribute("tList") %></option>
</select>
but the values are getting display in a single row in the combo box not row wise,where i am going wrong ?
I'd suggest adding a jstl loop:
<select name="test">
<c:forEach items="${sessionScope.tList}" var="item">
<option value="${item}">${item}</option>
</c:forEach>
</select>
精彩评论