SpringMVC3 在GAE 获取 Session
/**
* 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;
}
* 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;
}