0
List<Object> result = (List<Object>)guestSession.Available_RoomType(startDateString, endDateString, name);

             List<Roomtype> new_room;
                            List<? extends Object> list = result;
                            new_room = (List<Roomtype>) list;

    %>
    <table>
        <%if(new_room!=null){
                            for(Roomtype r : new_room){%>
        <tr>

            <td><%= r.getName() %></td>
            <td><%= r.getDescription() %></td>
            <td><%= r.getPrice() %></td>
        </tr>

   <%}
        }%>
    </table><%
        }
    %>

new_room has size 0 when i debug it but the properties are not displaying. the compiler jumps everything in the tr. Please any reason for this because the page comes blank after.

Mike Laren
  • 8,028
  • 17
  • 51
  • 70
kimmie
  • 21
  • 8

1 Answers1

0

First, please don't use scriptlets. Second,

List<Roomtype> new_room = (List<Roomtype>) guestSession.Available_RoomType(
        startDateString, endDateString, name);
%>
<table>
    <% if(new_room != null) {
       for(Roomtype r : new_room){%>

Finally, I suggest you take a look at <c:forEach> as it supports iterating a collection.

Community
  • 1
  • 1
Elliott Frisch
  • 198,278
  • 20
  • 158
  • 249