Search code examples
javajspjstl

How to render Select in Jsp for a list of Object


I have a list of Object containing issue number and issue name both belonging to separate table.

issue Number    issue name 
Rac12345         test User Cannot Login 
Rac345544        Logs are not printed

I am getting them in my Controller but in JSP i am not able to render it

my code in JSP

   <tr>
        <td>Issues:</td>
        <td><form:select path="issues" items="${unassignedIssueList}"
                var="c" itemValue="${c[0]}" itemLabel="${c[1]}" /></td>
        <td><form:errors path="issues" cssClass="error" /></td>
    </tr>

how do i render it?


Solution

  • I solved it by doing following

         <td>Issues:</td>
         <td><form:select path="issues">
              <c:forEach var="list" items="${unassignedIssueList}">
                 <option value="${list[0]}">${list[1]}</option>
              </c:forEach>
         </form:select></td>