SpringMVC3 在GAE 获取 Session

转自:http://www.cnblogs.com/Herist/archive/2011/04/10/1977944.html

    /**
     * returns the current http session object
     * 
     * @return session
     */
    @Override
    public HttpSession getSession() {        
        ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
        HttpSession contextSess = attr == null ? session : attr.getRequest().getSession(true);
        
        return contextSess; 
    }

 

posted @ 2013-03-01 16:50  horizon~~~  阅读(199)  评论(0编辑  收藏  举报