Java积累

import javax.servlet.http.HttpSession;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
//引入spring 框架
HttpSession requestSession  = ((ServletRequestAttributes)RequestContextHolder.
				getRequestAttributes()).getRequest().getSession();
//在业务层获取session,这样不需要把值一直带着,因为这是后期业务需要引入session参数,需要修改对方不少,就想到在后台业务层获取session

 

你可能感兴趣的:(java)