tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Pyeron <ja...@pyeron.com>
Subject Re: JSTL quickie [ot]
Date Sun, 19 Jan 2003 03:48:12 GMT
thanks, i was having mental blocks on this one:

its a page to list the exceptions thrown by tomcat for a web app. We never 
display an exception to a user, instead we give them a message like :

 We are sorry that you are having trouble with this application. If you 
require assistance with this application please contact our support 
department. For your reference you have been assigned an incident number 
of #112048. 

and then look them up ourselves.

<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %><%@ taglib prefix="c"
uri="http://java.sun.com/jstl/core" %><html>
<sql:setDataSource dataSource="jdbc/DB" />
<sql:query var="result" >SELECT * FROM exceptions ORDER BY id DESC</sql:query>
<table border="1">
<c:forEach var="indx" items="${result.rows}"><tr>
<td><c:out value="${indx.id}"/>
<td><c:out value="${indx.ts}"/>
<td><pre><%= new String((byte[])((java.util.Map)pageContext.findAttribute("indx")).get("exceptiontxt"))%></pre>
</c:forEach>
</table>
</html>

On Sat, 18 Jan 2003, Kris Schneider wrote:

Don't think that's gonna happen with JSTL. Something like the following 
expression element should work:

<td>
   <pre>
     <%= new 
String(((ClassOfIndx)pageContext.findAttribute("indx")).getExceptiontxt()) 
%>
   </pre>

> On Sat, 18 Jan 2003, Jason Pyeron wrote:
> 
> 
> 
>            <td><pre><c:out value="${indx.exceptiontxt}"/></pre>
> 
> is giving a [B@19c4091, thats a byte array, how do I burp this out as 
> text?
> 
> -jason




-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                   http://www.pyerotechnics.com   -
- Owner & Lead                  Pyerotechnics Development, Inc. -
- +1 410 808 6646 (c)           500 West University Parkway #1S -
- +1 410 467 2266 (f)           Baltimore, Maryland  21210-3253 -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain 
privileged, proprietary, or otherwise private information. If you
have received it in error, purge the message from your system and 
notify the sender immediately.  Any other use of the email by you 
is prohibited.




--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message