<%@ page session="true" %>
<%
// Get the session data value
Integer ival = (Integer) session.getValue ("counter");
if (ival == null) ival = new Integer (1);
else ival = new Integer (ival.intValue() + 1);
session.putValue ("counter", ival);
%>
You have hit this page <%= ival %> times.
<%
out.println("Your Session ID is " + session.getId() + "
");
if ( request.getMethod().equals("POST")) {
out.println("Dernier Input était: " + session.getValue("lastInput") + "
");
String input = request.getParameter("input");
session.putValue ("lastInput", input);
}
%>
Click here to see the source