?? ssosessionlistener.java
字號:
package com.neusoft.sso;
import java.util.Set;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
/**************************************************
* NAME : SsoSessionListener.java
* HISTORY
* 2007-08-15 shanc 創建文件
* 注意:這個類是個不需要程序員手動調用的類,使用Sso組件的程序員,不建議了解該類的具體結構
*************************************************/
public class SsoSessionListener implements HttpSessionListener{
public void sessionCreated(HttpSessionEvent arg0) {
// TODO Auto-generated method stub
}
/*
* SsoSessionListener是用于監聽session的,當session將要被銷毀時,完成以下工作
* 清除自身應用的context中的用戶表ssouserset中的該用戶記錄
* 注意:該方法不需要手動調用,只需要在web.xml中配置listener屬性
* @author shanc
*
*/
public void sessionDestroyed(HttpSessionEvent event) {
// TODO Auto-generated method stub
if(!Global.getSSOFlag()){
return ;
}
HttpSession session = event.getSession();
String paraName = (String)session.getAttribute(Global.getParaName());
this.clearSelf(session.getServletContext(),paraName);
}
private void clearSelf(ServletContext context,String paraName){
Set set = (Set)context.getAttribute(Global.SET_NAME);
set.remove(paraName);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -