我想显示一个hashmap但是通过key和每个值一个td而不是一个整数?继承人的意思是:
String getDescription = rs.getString("description");
int level = rs.getInt("level");
Timestamp startDate = rs.getTimestamp("startDateTime");
Timestamp endDate = rs.getTimestamp("endDateTime");
String LessonId = rs.getString("lessonid");
this.less = new Lesson(getDescription, startDate, endDate, level, LessonId);
putDescriptions.add(less.description);
putStartTime.add(less.startTime);
endTime.add(less.endTime);
List list = Arrays.asList(less.date.split("2010"));
for (int i = 0; i < list.size(); i++) {
putDates.add(list.get(i).toString());
Level.add(less.level);
LessonID.add(less.ID);
this.lessons.put("description", putDescriptions);
this.lessons.put("StartDate", putDates);
this.lessons.put("StartTime", putStartTime);
this.lessons.put("EndTime", endTime);
this.lessons.put("Level", Level);
this.lessons.put("LessonID", LessonID);
//上面是bean代码
jstl:
<c:forEach var="temp" items="${sessionScope.AvailableLessons['description']}">
<tbody>
<tr>
<form action="" method="POST">
<td>
<c:out value="${temp}"/>
答案 0 :(得分:0)
以下就足够了,
1。)循环应在外面,但在table tag
内。
2。)在for each
圈内,根据需要打开tr or td
。
<c:forEach var="myVar" items="${myMap}">
${myVar.key} ${myVar.value}
</c:forEach>