Hallo,
in meiner JSP-Webapplikation mache ich eine Sql-Abfrage, deren Ergebnis ich mit cut ausgeben will. Code sieht ungefähr so aus:
(JBoss 4.2.3, Oracle 10g, Web-app 2.5)
<sql:query var="queryResults">
SELECT kat1, kat2, SUM(bet)
FROM tab1
WHERE
dat BETWEEN '01.01.2007' AND '31.12.2007'
GROUP BY kat1,kat2
ORDER BY kat1,kat2
</sql:query>
<table>
<c:forEach var="row" items="${queryResults.rows}">
<tr>
<td><cut value="${row.kat1}" /></td>
<td><cut value="${row.kat2}" /></td>
<td><cut value="${row[2]}" /></td>
</tr>
</c:forEach>
</table>
Allerdings bekomme ich dabei eine Exception:
org.apache.jasper.JasperException: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
Das Ergebnis von SUM(bet) ist jeweils eine Dezimalzahl wie 1000,23.
Kann ich cut oder irgendwie anders beibringen, das es auch einen long akzeptiert? Oder wie macht man sowas normalerweise, ist cut für eine Dezimalzahl nicht gedacht?
Danke für eine Antwort
braca
in meiner JSP-Webapplikation mache ich eine Sql-Abfrage, deren Ergebnis ich mit cut ausgeben will. Code sieht ungefähr so aus:
(JBoss 4.2.3, Oracle 10g, Web-app 2.5)
<sql:query var="queryResults">
SELECT kat1, kat2, SUM(bet)
FROM tab1
WHERE
dat BETWEEN '01.01.2007' AND '31.12.2007'
GROUP BY kat1,kat2
ORDER BY kat1,kat2
</sql:query>
<table>
<c:forEach var="row" items="${queryResults.rows}">
<tr>
<td><cut value="${row.kat1}" /></td>
<td><cut value="${row.kat2}" /></td>
<td><cut value="${row[2]}" /></td>
</tr>
</c:forEach>
</table>
Allerdings bekomme ich dabei eine Exception:
org.apache.jasper.JasperException: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
Das Ergebnis von SUM(bet) ist jeweils eine Dezimalzahl wie 1000,23.
Kann ich cut oder irgendwie anders beibringen, das es auch einen long akzeptiert? Oder wie macht man sowas normalerweise, ist cut für eine Dezimalzahl nicht gedacht?
Danke für eine Antwort
braca