Skip to Main Content
Jakarta Struts Cookbook
book

Jakarta Struts Cookbook

by Bill Siggelkow
February 2005
Intermediate to advanced content levelIntermediate to advanced
528 pages
12h 53m
English
O'Reilly Media, Inc.
Content preview from Jakarta Struts Cookbook

13.5. Troubleshooting JSP Pages

Problem

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.

Solution

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Jakarta Struts

Programming Jakarta Struts

Chuck Cavaness
Beginning Spring Framework 2

Beginning Spring Framework 2

Bruce Snyder, Sing Li, Anne Horton, Thomas Van de Velde, Naveen Balani, Christian Dupuis
Java Cookbook

Java Cookbook

Ian F. Darwin
Struts 2 in Action

Struts 2 in Action

J. Scott Stanlick, Chad Michael Davis, Donald J. Brown

Publisher Resources

ISBN: 059600771XSupplemental ContentErrata Page