Integer counterObj = (Integer) ctx.getAttribute("numUsers"); int counter = (counterObj == null ? 0 : counterObj.intValue()); if (userAdded) { counter++; } else { if (counter > 0) counter--; } ctx.setAttribute("numUsers", new Integer(counter));
if (attributeIsUser(event)) adjustUserCounter(event.getSession().getServletContext(), true);
String name = event.getName(); Object value = event.getValue(); return "user".equals(name) && value instanceof com.oreilly.strutsckbk.ch07.User;
if (attributeIsUser(event)) adjustUserCounter(event.getSession().getServletContext(), false);