In .jsp pages by using Expression Language, i am wanting to retrieve all header names along with their values.
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<table>
<tr>
<th>Name</th>
<th>Value</th>
</tr>
<c:forEach items="${pageContext.request.headerNames}" var="item">
<tr>
<td>${item}</td>
<td>${header["${item}"]}</td>
</tr>
</c:forEach>
</table>
header is as far as i know a map
- The quotation marks are required for specifying a property in a JavaBean or a key in a map
But <td>${header["${item}"]}</td>
return null, even though <td>${item}</td>
return the header name.