getServletContext().setAttribute("version", version);
getServletContext().setAttribute("started", new DateTime().toString("dd/MM/yyyy hh:mm:ss (ZZZ)"));
ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
PostPersistenceEventListener selectingListener = (PostPersistenceEventListener) context.getBean("selectingPostPersistenceEventListener");
SessionFactoryImpl sessionFactoryBean = (SessionFactoryImpl) context.getBean("sessionFactory");
sessionFactoryBean.getEventListeners().setPostDeleteEventListeners(new PostDeleteEventListener[]{selectingListener});
sessionFactoryBean.getEventListeners().setPostUpdateEventListeners(new PostUpdateEventListener[]{selectingListener});
sessionFactoryBean.getEventListeners().setPostInsertEventListeners(new PostInsertEventListener[]{selectingListener});