<%-- Declaration --%> <%! int actualVisitors = 0; int getVisitor() { return (int) (Math.random() * 1000000); } %> Hello, you are visitor No. <%-- Expression --%> <%= getVisitor() %>, <%-- Scriptlets --%> <% ++actualVisitors; %> or actual visitor No. <%-- Another Expression --%> <%= actualVisitors %>.