只有当前页面能获取设置的值。
通过pageContext对象的setAttribute和getAttribute实现。
pageContext.setAttribute("name","gareen");
pageContext.getAttribute("name")
requestContext
表示只能请求一次,请求完后数据回收,和pageContext不同的是,
它可以在服务端跳转的两个页面中传递,客户端跳转则不行
request.setAttribute("name","gareen");
request.getAttribute("name")
sessionContext
表示可以在一个用户访问的同一个会话中传递
session.setAttribute("name","gareen");
response.sendRedirect("getContext.jsp");
applicationContext
所有用户共享
application.setAttribute("name","gareen");
application.getAttribute("name")
其中application是ServletContext的一个实例



