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

    可折叠代码块

     
     
    大笑
  • 相关阅读:
    使用python三方库xlrd解析excel数据
    testng之listener
    使用Junit实现批量运行
    gojs绘流程图
    sqlserver
    Android学习笔记之 android:collapseColumns ,android:shrinkColumns 和stretchColumns
    myBatis oracle 与mysql自增问题
    Oracle总结
    Oracle 树操作(select…start with…connect by…prior)
    Oracle 获取当前日期及日期格式
  • 原文地址:https://www.cnblogs.com/zhangzs000/p/6040793.html
Copyright © 2011-2022 走看看