I've recently been switched to a Java project and one of the most frustrating parts of the application (other than barely knowing Java) is the error page would only show a "An error as occurred" message and not the actual stack trace. In production this is a perfectly valid scenario, but when developing having to go back to RAD and scroll through the console to find the error message was wasting a lot of time, so after a decent amount of googling I found a way to dump the stack trace to the page.
The code ended up looking like this. In the message board post they used exception instead of error, but hopefully you get the point.
Object billingError = request.getSession().getAttribute(RequestParamConstants.UNKNOWN_BILLING_ERROR);
error = (Throwable)billingError;
<%@page isErrorPage="true" import="java.io.*"%>
A while after implementing this I ran into an error where the first line was about 400 characters long, so I had to scroll way over to the right. This is because by default the pre tag does not wrap, so I added this simple css fix which allows the pre tag to wrap