Difference between ${requestScope} and ${pageContext.request}

来源:互联网 发布:手机注册淘宝店铺流程 编辑:程序博客网 时间:2024/03/29 08:48

1. ${requestScope} is used to get some variable which was set by request.setAttribute().

2. ${pageContext.request} is used to get some attribute of the request object, for example, ${pageContext.request.method} is to get the method type of the request, it equals to the java code "request.getMethod()", there are several methods exist in the HttpServletRequest object.

3. you can't use ${requestScope.contextPath} to get the contextPath value, you can only use ${pageContext.request.contextPath} to get this value.