一、从request中取
request.setAttribute("test", "hello");
1,el表达式:<% String test = request.getAttribute("test")%>
2,jstl:${test }或${requestScope.test}因为直接去是默认request对象中的数据:requestScope
二、从session中取
request.getSession().setAttribute("test", "hello")
1,el表达式:<%String test = request.getSession().getAttribute("test") %>
2,jstl:${sessionScope.test }