@Controller
) with @Scope(\"session\")
.
After trying all the different alternatives suggested all I had to do was add aop:scoped-proxy to my bean definition and it started working.
securityService is injected into my managedbean which is view scoped. This seems to work fine. According to spring documentation this is supposed to throw a BeanCreationException since securityService is a singleton. However this does not seems to happen and it works fine. Not sure whether this is a bug or what the side effects would be.