February 2005
Intermediate to advanced
528 pages
12h 53m
English
You want to see a dump of the names and values of servlet request and HTTP session attributes and for a particular JSP page so you can troubleshoot rendering problems.
Include the debug.jsp file shown on the JSP page (see Example 13-5).
Example 13-5. JSP dump of request, session, and context data
<hr width="3px"> Debug Information:<br> <table border="1" width="50%" class="debug"> <tr> <th colspan="3" style="background:orange"> <b>Request Parameters</b> </th> </tr> <c:forEach items="${paramValues}" var="parameter"> <tr> <td><c:out value="${parameter.key}"/></td> <td colspan="2"> <c:forEach var="value" items="${parameter.value}"> <textarea rows="2" cols="50"> <c:out value="${value}"/> </textarea> </c:forEach> </td> </tr> </c:forEach> <tr> <th colspan="3" style="background:orange"> <b>Header Values</b> </th> </tr> <c:forEach items="${header}" var="h"> <tr> <td><c:out value="${h.key}"/></td> <td colspan="2"> <textarea rows="2" cols="50"> <c:out value="${h.value}"/> </textarea> </td> </tr> </c:forEach> <tr> <th colspan="3" style="background:orange"> <b>Initialization Parameters</b> </th> </tr> <c:forEach items="${initParam}" var="parameter"> <tr> <td><c:out value="${parameter.key}"/></td> <td colspan="2"> <textarea rows="2" cols="50"> <c:out value="${parameter.value}"/> </textarea> </td> </tr> </c:forEach> <tr> <th colspan="3" style="background:orange"> <b>Cookies</b> </th> </tr> <c:forEach items="${cookie}" var="mapEntry"> <tr> <td rowspan="8"><c:out ...