zoukankan      html  css  js  c++  java
  • windows live Writer test

    package com.newegg.shopping.util.listener;
    
    import javax.servlet.http.HttpSessionAttributeListener;
    import javax.servlet.http.HttpSessionBindingEvent;
    import javax.servlet.http.HttpSessionEvent;
    import javax.servlet.http.HttpSessionListener;
    
    public class LoggedUserCounter implements HttpSessionListener, HttpSessionAttributeListener {
    	
    	private static int count = 0;
    	
    	public void sessionCreated(HttpSessionEvent event) {
    System.out.println("------------session created!");
    	}
    
    	public void sessionDestroyed(HttpSessionEvent event) {
    	}
    
    	public void attributeAdded(HttpSessionBindingEvent event) {
    		if(event.getName().equals("admin") && ((String)event.getValue()).equals("admin")) {
    			count ++;
    			System.out.println("a user logged in ! now total :" + count);
    		}
    	}
    
    	public void attributeRemoved(HttpSessionBindingEvent arg0) {
    		
    	}
    
    	public void attributeReplaced(HttpSessionBindingEvent arg0) {
    		
    	}
    
    }

    可折叠代码块

     
     
    大笑
  • 相关阅读:
    机器学习之KNN算法学习笔记
    机器学习之决策树算法学习笔记
    RNN神经网络
    深度学习笔记-Tensorflow(一)
    CNN卷积神经网络-tensorflow
    个人喜欢的网址
    CSP2020游记
    题解 GDFZOJ 2020普转提十连测day5
    讲义 GDFZOJ 【38】 动态规划基础3
    题解 GDFZOJ 【2314】 东风谷早苗
  • 原文地址:https://www.cnblogs.com/zhangzs000/p/6040793.html
Copyright © 2011-2022 走看看