Tags that Define EL Variables

An EL variable is an attribute of the JSP page context. A variable can be added using the JSTL <c:set> action, or the setAttribute() method of the instance variable called pageContext that points to the javax.servlet.jsp.PageContext object of the Web page. The setAttribute() method takes the following parameters:

  • The name of the scripting variable. This name is used to refer to the variable on the Web page.

  • The object reference to the variable to be added to the page.

  • The scope of the variable can be one of the following constants defined in PageContext:

    • PAGE_SCOPE Available until the current page processing completes (this is the default)

    • REQUEST_SCOPE Available until the current request completes allowing the variable ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.