Example #1
0
 public void attributeReplaced(HttpSessionBindingEvent evt) {
   final String name = evt.getName();
   if (!shallIgnore(name)) {
     final Session sess = Sessions.getCurrent();
     if (sess instanceof SimpleSession && evt.getSession().equals(sess.getNativeSession()))
       ((SimpleSession) sess).getScopeListeners().notifyReplaced(name, evt.getValue());
   }
 }
 @Override
 public void attributeAdded(HttpSessionBindingEvent _event) {
   System.out.println(
       "edu.temple.cis3238.wiki.WikiEventMonitor.[SESSION]attributeAdded()\n added "
           + _event.getName()
           + _event.toString());
   LOG.info(Objects.toString(_event.getValue().toString()));
   LOG.info(Objects.toString(_event.getSource()));
 }
 private void checkAttribute(
     HttpSessionBindingEvent event,
     String orderAttributeName,
     String keyItemName,
     String message) {
   String currentAttributeName = event.getName();
   String currentItemName = (String) event.getValue();
   if (currentAttributeName.equals(orderAttributeName) && currentItemName.equals(keyItemName)) {
     ServletContext context = event.getSession().getServletContext();
     context.log("Customer" + message + keyItemName + ".");
   }
 }