6.12 EXPRESSION LANGUAGE (EL)

JSP EL (Expression Language) was added to JSP 2.0 Specifications makes it easier to get values of variables, as opposed to complex scripting which would have been otherwise necessary. An example of EL is shown below, which gets the property of the emp object.

${emp.name}

EL looks like Java but they have lot of differences. In fact, EL can be used to access Java objects without little knowledge of Java. Its predominant usage is through implicit objects that are available. They are mentioned as follows:

  • pageContext
  • Standard Scopes
    • pageScope
    • requestScope
    • sessionScope
    • applicationScope
  • param
  • paramvalues
  • header
  • headerValues
  • cookie
  • initParam

Get Web Technology: Theory and Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.