Changeset 27:f3451edb0bba
- Timestamp:
- 05/31/09 18:45:40 (15 years ago)
- Author:
- František Kučera <franta-hg@…>
- Branch:
- default
- Message:
-
Výstupní tabulka: formátování vybraných datových typů (datum, číslo…).
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
r26
|
r27
|
|
2 | 2 | <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" |
3 | 3 | xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" |
| 4 | xmlns:fn="http://java.sun.com/jsp/jstl/functions" |
4 | 5 | xmlns:c="http://java.sun.com/jsp/jstl/core" |
5 | 6 | version="2.0"> |
… |
… |
|
57 | 58 | <tr> |
58 | 59 | <c:forEach var="bunka" items="${radek}"> |
59 | | <td><c:out value="${bunka}" /></td> |
| 60 | <!-- <formátováníPodleDatovýchTypů> --> |
| 61 | <c:choose> |
| 62 | <c:when test="${bunka.class == 'class java.sql.Timestamp'}"> |
| 63 | <td> |
| 64 | <fmt:formatDate value="${bunka}" pattern="dd.MM.yyyy HH:mm:ss"/> |
| 65 | </td> |
| 66 | </c:when> |
| 67 | <c:when test="${bunka.class == 'class java.sql.Date'}"> |
| 68 | <td> |
| 69 | <fmt:formatDate value="${bunka}" pattern="dd.MM.yyyy"/> |
| 70 | </td> |
| 71 | </c:when> |
| 72 | <c:when test="${bunka.class == 'class java.lang.Integer' || bunka.class == 'class java.math.BigDecimal'}"> |
| 73 | <td class="cislo"> |
| 74 | <fmt:formatNumber value="${bunka}" pattern="###,###.###"/> |
| 75 | </td> |
| 76 | </c:when> |
| 77 | <c:otherwise> |
| 78 | <td> |
| 79 | <c:out value="${bunka}" /> |
| 80 | <c:out value=" ${bunka.class}" /> |
| 81 | </td> |
| 82 | </c:otherwise> |
| 83 | </c:choose> |
| 84 | <!-- </formátováníPodleDatovýchTypů> --> |
60 | 85 | </c:forEach> |
61 | 86 | </tr> |