SpringMVC3 在GAE 获取 Session
时间:2011-04-10 来源:Herist
/**
* 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;
}
相关阅读 更多 +