spring mvc出现Could not instantiate bean class [org.hibernate.Session]: Specified class is an interfac

在springmvc中使用session是遇到这个错误org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.Session]: Specified class is an interface


下面为网页中请求的方法:

@RequestMapping("xxx")
public  ModelAndView logOut(Session session,ModelAndView modelAndView) {
	session.removeAttribute("userinfo");
	return modelAndView;
}

将Session改为HttpSession
@RequestMapping("xxx")
public  ModelAndView logOut(HttpSession session,ModelAndView modelAndView) {
	session.removeAttribute("userinfo");
	return modelAndView;
}



你可能感兴趣的:(javaweb)