<!-- Collection of code snippets by Arne Vajhøj -->
<!-- (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) -->
<jsp:useBean id="counter" class="java.util.HashMap" scope="application"/>
<%
synchronized(counter) {
    int mycount = 0;
    if(counter.get("pagetwo") != null) {
        mycount = ((Integer)counter.get("pagetwo")).intValue();
    }
    mycount++;
    counter.put("pagetwo", new Integer(mycount));
}
%>
I am page two !
<hr>
Counters:
<ul>
<li>page one: <%=counter.get("pageone")%>
<li>page two: <%=counter.get("pagetwo")%>
</li>
