Declaring a variable in a scriptlet

The variable declaration is legal, but it didn’t quite work the way Pauline hoped.

What she tried:

image with no caption

What she got the first time she hit the page:

image with no caption

What she got the second, third, and every other time she hit the page:

image with no caption

Get Head First Servlets and JSP, 2nd Edition now with O’Reilly online learning.

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