How can I maintain "application scope data" in Servlets or JSPs as ASPs do?

In the Servlets 2.1 spec, you can set a Servlet Context Attribute. For example, getServletContext().setAttribute("counter", new foo.Counter());
. You can also access (or initialize) these Attributes as Application Scope Beans in a JSP, using <jsp:useBean scope="application">.