%@ taglib prefix="c" uri="http://java.sun.com/jstl/ea/core" %>
In the context of JSTL, some special predefined objects are made available.
params
)Request parameters can be accessed through a Map object called "params". See the Map Access page for information on how to conveniently access Map objects. As request parameters can have multiple values, the map entries are actually arrays, so the index operator needs to be used to access the actual string value of the parameter.
Enter a value for the parameter "test", which will be displayed below using this technique.
Here is the parameter value:
Expression | Output |
---|---|
$params['test'][0] |
|
$params.test[0] |
cookies
)Cookies can be accessed through a Map object called "cookies". See the Map Access page for information on how to conveniently access Map objects.
Here are the cookies:
$cookie.name |
$cookie.value |
cookies[cookie.value.name].value |
---|---|---|
headers
)Request headers can be accessed through a Map object called "headers". See the Map Access page for information on how to conveniently access Map objects.
Accessing specific headers:
Expression | Result |
---|---|
$headers.host |
|
$headers['user-agent'] |
Iteration over the headers:
$header.key |
$header.value |
---|---|
initParams
)Init parameters can be accessed through a Map object called "initParams". See the Map Access page for information on how to conveniently access Map objects.
Iteration over the init parameters:
$initParam.key |
$initParam.value |
---|---|