To permit the JSP page to access the data, the servlet needs to use SetAttribute to store the data in one of the Locations: The HttpServletRequest, the HttpSession, or the ServletContext. Objects in these locations is known as "scoped variables," andthe expression language have a quick and easy-to-do To access them.
You can also has scoped variables stored in the PageContext object, it's much less useful because the servlet and The JSP page does not share PageContext objects. So, page-scoped variables apply only to objects stored earlier in the same JSP page, not to objects stored by a servlet. To output a scoped variable, you simply use the its name with an expression language element.
For example, ${name} means to search the PageContext, HttpServletRequest, HttpSession, and ServletContext (on that Ord ER) for the attribute named. If The attribute is found, it toString method is called and that result is returned. If Nothing was found, an empty string (not NULL or a error message) is returned.
So, for example, the following and the expressions are equivalent. ${name} <%= Pagecontext.findattribute ("name")%>
Http://pdf.coreservlets.com/JSP-EL.pdf
©prentice Hall and Sun Microsystems Press. Personal Use only
accessing Scoped Variables