//FROM CLASS A private static Map lastNotificationMap = new HashMap(); //FROM CLASS B ServletContext servletContext = this.getServlet().getServletContext(); Map lastNotificationMap = (Map) servletContext.getAttribute("lastNotificationMap"); String lastNotificationKey = pVO.getTagId() + "-" + pVO.getPerfId(); long lastNotificationTS = lastNotificationMap.get(lastNotificationKey);