I'm trying to return a formatted date from an Oracle database. I format the date in
the
query itself using the TO_CHAR() funtion. The problem is, when I use the TO_CHAR()
function, JSP is acting like nothing is returned. If I take the function out and just
select the column as normal, it outputs but with the full TimeStamp (which I don't
want).
Is there anything wrong with what I've done? Is there any other way to format a date's
output with JSTL?
Here's the snippet of relevant code with the TO_CHAR() function included:
<sql:query var="resource_list">
SELECT
TO_CHAR(dob, 'DD-MON-YYYY')
FROM ccevs_resource_registry
</sql:query>
<table width="100%" border="1" cellpadding="2" cellspacing="0">
<tr>
<th nowrap>Date of Birth</th>
</tr>
<%-- set variable for checking if current row is odd or even --%>
<c:set var="rowNum" value="1" />
<c:forEach items="${resource_list.rows}" var="resource_row">
<%-- color every even numbered row --%>
<tr
<c:if test="${rowNum % 2 == 0}"> bgcolor="ffff99"</c:if>
>
<td>
<c:if test="${empty resource_row.dob}"> </c:if>
<c:out value="${resource_row.dob}" />
</td>
</tr>
<%-- increment rowNum counter --%>
<c:set var="rowNum" value="${rowNum + 1}" />
</c:forEach>
</table>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]