HttpSession session = request.getSession();
session.setMaxInactiveInterval(-1);
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
ctx.load("classpath:app-context.xml");
ctx.refresh();
//Keeping track of user session and notes
PreferencesService preferencesService = ctx.getBean("preferencesService", PreferencesService.class);
UsersService usersService = ctx.getBean("usersService", UsersService.class);