WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(ServletActionContext.getServletContext());
SessionFactory sessionFactory = (SessionFactory) wac.getBean("sessionFactory",SessionFactory.class); Session session = sessionFactory.getCurrentSession(); |
|