在springmvc中使用session是遇到这个错误org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.Session]: Specified class is an interface
下面为网页中请求的方法:
将Session改为HttpSession@RequestMapping("xxx") public ModelAndView logOut(Session session,ModelAndView modelAndView) { session.removeAttribute("userinfo"); return modelAndView; }
@RequestMapping("xxx") public ModelAndView logOut(HttpSession session,ModelAndView modelAndView) { session.removeAttribute("userinfo"); return modelAndView; }