首页 > 代码库 > SpringMVC存取Session的两种方法

SpringMVC存取Session的两种方法

方法一:使用servlet-api

@Controller
public class ManagerController {

	@Resource
	private ManagerService managerServiceImpl;
	
	@RequestMapping(value = http://www.mamicode.com/"manager/login.do",method = RequestMethod.GET)  >

方法二:使用SessionAttributes

@Controller
@SessionAttributes("manager")
public class ManagerController {

	@Resource
	private ManagerService managerServiceImpl;
	
	@RequestMapping(value = http://www.mamicode.com/"manager/login.do",method = RequestMethod.GET)  >

SpringMVC存取Session的两种方法