<%@ page import="java.util.Vector" session="true" errorPage="../error.jsp" %>
<%
// Get the person's session counter
Integer ival = (Integer) session.getValue ("counter");
// The person is new, has no session counter
if (ival == null) {
ival = new Integer (1);
}
else ival = new Integer (ival.intValue() + 1);
// Add the new Integer object to the session (with key = counter)
session.putValue ("counter", ival);
%>
You are at stage <%= ival %> of the experiment.
That is enough, but you can restart (needs to be implemented !!!!) <% } else { words.add(input); session.putValue ("words", words); } } %>
Click here to see the source