In other words, the Container takes everything you type between the <%= and %> and puts it in as the argument to a statement that prints to the implicit response PrintWriter out.
When the Container sees this:
<%= Counter.getCount() %>
It turns it into this:
out.print(Counter.getCount());
If you did put a semicolon in your expression:
<%= Counter.getCount(); %>
That would be bad. It would mean this:
NEVER end an expression with a semicolon!
<%= neverPutASemicolonInHere %>
<%= becauseThisIsAnArgumentToPrint() %>
There are no Dumb Questions
Sharpen your pencil
Decide which of the following expressions are and are not valid, and why. We haven’t covered every example here, so make your best guess based on what you know about how expressions work. (Answers are later in this chapter so do this NOW.)
Valid? (Check if valid, and if not, explain why not.)