header & headerValues
The header and headerValues objects are used to retrieve the header values normally available through the request.getHeader and request.getHeaders methods.
Ex: To access a header named user-agent, use the expression${header.user-agent} or ${header["user-agent"]}.
${header.accept}
${headerValues.accept[0]}
test.jsp
<%@ page isELIgnored="false" %> <table border = 2> <tr><td>header.cookie :</td><td>${header.cookie}</td></tr> <tr><td>header.connection</td><td>${header.connection}</td></tr> <tr><td>headerValues.host[0]</td><td>${headerValues.host[0]}</td></tr> <tr><td>headerValues.accept[0]</td><td>${headerValues.accept[0]}</td></tr> <tr><td>header.user-agent</td><td>${header.user-agent}</td></tr> </table> |
Output: http://localhost:8080/Scwcd_jsp/test.jsp
No comments:
Post a Comment