Literal Expressions

Chapter 7 - Building JSP Pages Using the Expression Language (EL)

    Literal Expressions

  • Literal Expressions

    A literal expression is an expression used to evaluated to the text of the expression, which is of type String. A literal expression does not use the ${} or #{} delimiters.

    Literal expression that includes the reserved ${} or #{} syntax:

    • By creating a composite expression as shown:


    The resulting values would then be the strings ${exprA} and #{exprB}.

    • By using the escape characters \$ and \# to escape what would otherwise be treated as an eval-expression:


    The resulting values would again be the strings ${exprA} and #{exprB}.When a literal expression is evaluated, it can be converted to another type.

© 2015 by Learncertification All Rights Reserved. The certification names are the trademarks of their respective owners. Terms & Privacy Policy