The Value Store

<% String command = request.getParameter("command"); %> <% String variable = request.getParameter("variable"); %> <% if (command.equals("reset")) { application.setAttribute(variable, "0"); } else if (command.equals("inc")) { int value = Integer.parseInt((String)application.getAttribute(variable)) + 1; application.setAttribute(variable, String.valueOf(value)); } %> The value of <%= variable %> is now <%= application.getAttribute(variable) %>