Note that there are some explanatory texts on larger screens.

plurals
  1. POProcess data with JSTL
    text
    copied!<p>I'm brand new to JSTL and have a question because I need to process some data before displaying it with HTML. </p> <p>Here's my data returned from server: </p> <pre><code>&lt;participantMeetingList&gt; &lt;meeting&gt; &lt;meetingName&gt;Test&lt;/meetingName&gt; &lt;description&gt;Description for test meeting&lt;/description&gt; &lt;startTime&gt;2013-06-13 00:45:00.0&lt;/startTime&gt; &lt;endTime&gt;2013-06-13 02:00:00.0&lt;/endTime&gt; &lt;creatorName&gt;me@test.com&lt;/creatorName&gt; &lt;/meeting&gt; &lt;meeting&gt; &lt;meetingName&gt;HTML 5 lobby test&lt;/meetingName&gt; &lt;description&gt;Description for lobby test&lt;/description&gt; &lt;startTime&gt;2013-06-04 11:30:00.0&lt;/startTime&gt; &lt;endTime&gt;2013-06-04 12:30:00.0&lt;/endTime&gt; &lt;creatorName&gt;you@test.com&lt;/creatorName&gt; &lt;/meeting&gt; &lt;/participantMeetingList&gt; </code></pre> <p>I'm using this JSTL to simply render 1 row after another for each record: </p> <pre><code>&lt;div id="meeting-schedule"&gt; &lt;c:forEach var="meeting" items="${response.mMeetingList}" begin="0" end="5"&gt; &lt;div class="row"&gt; &lt;!-- MEETING DAY AND DATE --&gt; &lt;div class="span1"&gt; &lt;small class="muted"&gt;&lt;fmt:formatDate value="${meeting.startTime}" type="date" pattern="E MMM"&gt;&lt;/fmt:formatDate&gt;&lt;/small&gt; &lt;h2&gt;&lt;fmt:formatDate value="${meeting.startTime}" type="date" pattern="d"&gt;&lt;/fmt:formatDate&gt;&lt;/h2&gt; &lt;/div&gt; &lt;ul class="span4 unstyled"&gt; &lt;li&gt; &lt;a href="#" class="row" onclick="getMeetingDetails(${meeting.meetingId})"&gt; &lt;div class="span1"&gt;&lt;fmt:formatDate value="${meeting.startTime}" type="time" pattern="h:mm a"&gt;&lt;/fmt:formatDate&gt;&lt;/div&gt; &lt;div class="span3"&gt;${meeting.meetingName}&lt;/div&gt; &lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/c:forEach&gt; &lt;/div&gt; </code></pre> <p>However, our designer now says they want one row for each date where the first td cell is the month and date and the second td cell is a list of meeting names and times. </p> <p>Can I do this using JSTL? Can anyone point me in the right direction to get started, please? </p> <p>Thanks for any helpful tips!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload