EL表达式的11个内置对象
<body>
<%--
1)pageContext 等价于 jsp的pageContext内置对象
--%>
<%--获取上下文路径 --%>
${pageContext.request.contextPath }
<hr/>
<%--
pageScope
requestScope
sessionScope
applicatinoScope
从指定的域中获取数据
${pageScope.username}
--%>
<%--
2)param: 获取参数
注意: param返回所有参数Map集合
--%>
<%=request.getParameter("name") %><br/>
<%=request.getParameterValues("name")[1] %><br/>
${param.username}
${param['name']}<br/>
${paramValues['name'][0] }-${paramValues['name'][1] }
<hr/>
<%--
3) header :获取请求头
headerValues
--%>
<%=request.getHeader("host") %><br/>
<%=request.getHeaders("host").nextElement() %><br/>
${header['host'] }<br/>
${headerValues['host'][0] }
<%--
4)cookie: 获取cookie
--%>
<hr/>
<%=request.getCookies()[0].getValue() %><br/>
${cookie['JSESSIONID'].name } - ${cookie['JSESSIONID'].value }
<hr/>
<%--
5) initParam: 获取全局参数
--%>
<%=application.getInitParameter("AAA") %><br/>
${initParam['AAA'] }
</body>