<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    java Source

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      14 Posts :: 24 Stories :: 8 Comments :: 0 Trackbacks
    package org.lambdasoft.web.support;

    import java.util.ArrayList;
    import java.util.Enumeration;
    import java.util.List;

    import javax.servlet.http.HttpSession;

    import org.apache.struts2.ServletActionContext;
    import org.lambdasoft.web.Enviroment;

    public class SessionSupport {
        
    private SessionSupport() {}
        
        
    /**
         * 獲取當前用戶Session
         * 
         * 
    @return httpSession
         
    */
        
    public final static HttpSession getSession() {
            
    return ServletActionContext.getRequest().getSession();
        }
        
        @SuppressWarnings(
    "unchecked")
        
    public final static void removeAllSession(HttpSession session) {
            
    if(session == null)
                
    return;
            Enumeration names 
    = session.getAttributeNames();
            
    if(names == null)
                
    return;
            List
    <String> sessionNamesList = new ArrayList<String>();
            
    while (names.hasMoreElements()) 
                sessionNamesList.add((String)names.nextElement());
            
    for (String sessionName : sessionNamesList) {
                session.removeAttribute(sessionName);
            }
        }
        
        
    /**
         * 添加或者更新Session票據信息
         * 
         * 
    @param sessionTick
         
    */
        
    public final static void updateSessionTick(SessionTick<TickInterface> sessionTick) {
            getSession().removeAttribute(Enviroment.getEnv().getEnv(
    "WEB_SESSION_KEY"));
            getSession().setAttribute(Enviroment.getEnv().getEnv(
    "WEB_SESSION_KEY"), sessionTick);
        }
        
        
    /**
         * 把用戶票據加入到Session
         * 
    @param account
         
    */
        
    public final static void addTickToSession(TickInterface account) {
            SessionTick
    <TickInterface> tick = new SessionTick<TickInterface>();
            tick.setAccount(account);
            updateSessionTick(tick);
        }
    }


    /*
     * SessionTick.java
     * Copyright (C) 2009  <JustinLei@gmail.com>
     *
     *        This program is free software; you can redistribute it and/or modify
     *        it under the terms of the GNU General Public License as published by
     *      the Free Software Foundation; either version 2 of the License, or
     *     (at your option) any later version.
     *
     *       This program is distributed in the hope that it will be useful,
     *      but WITHOUT ANY WARRANTY; without even the implied warranty of
     *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     *        GNU General Public License for more details.
     *
     
    */
    package org.lambdasoft.web.support;

    /**
     * Session Support
     * 
     * 
    @author lei.tang (justinlei@gmail.com)
     * @date 
     * 
    @version
     
    */
    import java.io.Serializable;

    public class SessionTick<extends TickInterface> implements Serializable{
        
    private static final long serialVersionUID = 1L;
        
    private T account = null;
        
        
    public SessionTick() {}
        
        
    public SessionTick(T account) {
            
    this.account = account;
        }
        
        
    public T getAccount() {
            
    return account;
        }
        
    public void setAccount(T account) {
            
    this.account = account;
        }
    }

    package org.lambdasoft.web.support;

    public interface TickInterface {
        Long getId();
    }
    posted on 2009-12-18 16:37 JustinLei 閱讀(1490) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: j8又粗又长又硬又爽免费视频| 处破女第一次亚洲18分钟| 国产精品内射视频免费| 全部免费国产潢色一级| MM1313亚洲国产精品| 国产一级淫片视频免费看| 香蕉97碰碰视频免费| 国产精品亚洲精品日韩已方| 国产免费牲交视频| 久久久久久久久无码精品亚洲日韩| 免费爱爱的视频太爽了| 猫咪免费观看人成网站在线| 亚洲午夜精品一级在线播放放| 中文在线观看国语高清免费| 亚洲VA成无码人在线观看天堂| 无码国产精品一区二区免费模式| 亚洲AV无码一区二区三区国产| 亚洲嫩草影院在线观看| 久久久久久国产a免费观看黄色大片| 亚洲乱码无限2021芒果| 最近免费中文字幕中文高清| 亚洲国产精品嫩草影院在线观看 | 亚洲黄色免费观看| 在线看片v免费观看视频777| 亚洲日韩AV无码一区二区三区人| 91精品免费不卡在线观看| 亚洲fuli在线观看| 又大又硬又爽免费视频| 久久精品免费电影| 亚洲天堂免费在线| 亚洲成a人片在线播放| 日韩电影免费观看| 亚洲日韩精品无码专区加勒比☆| 一级毛片直播亚洲| 日韩精品免费视频| 亚洲精品中文字幕| 亚洲精品国产精品乱码不99 | jizzjizz亚洲日本少妇| 亚洲伊人色欲综合网| 又粗又大又黑又长的免费视频| 羞羞漫画小舞被黄漫免费|