How to easily dump POST values using JSTL
Submitted by Matt Fleming on Mon, 2006-10-23 14:39.
How can I easily dump http POST parameters using JSTL? It is super easy...
I recently created a web app that uses the following flow:
- show page one
- SUBMIT
- controller a
- DATA_MISSING
- show page two
- SUBMIT
- controller a
- OK
So I need to carry all of the data from page one to page two, but I don't want to reconstruct a massive object graph to do so.
In controller a (step #4) I use a normal jsp forward. In the jsp step #5, the following JSTL renders the hidden form elements necessary for steps #6 and #7 to work properly.
<c:forEach items="${paramValues}" var="item">
<c:forEach var='value' items='${item.value}'>
<input type="hidden"
name="<c:out value="${item.key}"/>"
value="<c:out value="${value}"/>"/>
</c:forEach>
</c:forEach>
