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) {
    		
    	}
    
    }

    可折叠代码块

     
     
    大笑
  • 相关阅读:
    day7
    11.3NOIP模拟赛
    codeforces 880E. Maximum Subsequence(折半搜索+双指针)
    11.2NOIP模拟赛
    bzoj1483: [HNOI2009]梦幻布丁(vector+启发式合并)
    day9
    codeforces 1006 F(折半搜索)
    codeforces 28D(dp)
    P2210 Haywire(A*)
    4800: [Ceoi2015]Ice Hockey World Championship(折半搜索)
  • 原文地址:https://www.cnblogs.com/zhangzs000/p/6040793.html
Copyright © 2011-2022 走看看