public class DefaultSessionListener implements HttpSessionListener {
public void sessionCreated(HttpSessionEvent arg0) {
ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(arg0.getSession().getServletContext());
IMemberService memberService = (IMemberService) ctx.getBean("memberService"); // 填写要注入的类,注意第一个字母小写
}
public void sessionDestroyed(HttpSessionEvent se) {
}
}
时间: 2024-11-15 05:57:06