1

what is the meaning of the $ sign in the following code:

<h1 class="title">Welcome ${consumer.first_name} </h1>
Ananya
  • 11
  • 2
  • 1
    It is called EL stands for Expression Language which is different from JSTL. Moreover, `first_name` is a hateful variable name that doesn't confirm the Java naming convention. It should be `firstName` (always - as long as you're using the Java language). – Lion Apr 26 '13 at 10:49

2 Answers2

3

It is an expression (think of it as a means to access the value of a Java object).

${consumer.first_name} 

is equivalent to

<%
    out.print(consumer.getFirst_Name());
%>

Here, consumer would be an attribute in one of the scopes (request, session etc)

Read up on Expression Language

adarshr
  • 61,315
  • 23
  • 138
  • 167
0

That is one of the way to access variables. Have a look at this link.

Community
  • 1
  • 1
Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126