Forum Stats

  • 3,839,311 Users
  • 2,262,480 Discussions
  • 7,900,930 Comments

Discussions

not able to display the resultset of a List<String> in jstl

User_DTTUY
User_DTTUY Member Posts: 5 Blue Ribbon

Hi,

Basically, I need help to get the resultset of a list<String> that meet certain query conditions to be displayed in jstl.

The servlet shows the resultset of this list<String> successfully via System.out.println but I just can't get it work in jstl.

I need to mention that the list<String> is part of the model - User.

List<User>myList = new List<User>();

                    for (String s : subjs) {

                    if (subjs.contains("subject_name")) {             

                        subjs.add(rs.getString("subject_name"));                    

                        t.setsubjects(subjs);                     

                                                               

                    }

                    myList.add(t);

                    request.setAttribute("users", myList);

                }

<c:forEach items="${users}" var="t" varStatus="status">

        <tr>   

        <td><c:set var="t" value="${user.user_id }" scope="request" />           

        <c:out value="${user.tutor_id}" /></td>           

            <td>${t.zipcode} </td>

            <td>${t.contactNo} </td>

            <td>${t.subjects} </td>     // this is the part that I have problem in getting the specific element.

        </tr>       

        </c:forEach>       

Hope someone can give me some hints how to do this part.

Thanks.