I know this sounds strange, mixing CDI (Weld) and Spring for the controller.
But imagine this situation :
- With CDI, i can make use of the @ConversationScoped, which is one of my requirement (And so far i dont know whether i can use spring for this kind of scope, because if i can, i could just replace Weld with Spring, with the el-resolver in faces-config.xml)
- My services objects(@Service) along with the DAOs(@Repository) are to be managed by Spring
Now one question arise is that, inside my controller, how can i access my service object ?
Something like this wouldnt work i think :
@Named
@ConversationScoped
public class MyBean {
@Named
private SomeOtherBeanManagedByCDI myOtherBean; // this will work
@Autowired
private MySpringBean mySpringBean; // dont think that this will work
....
}
Any ideas on how to make use of spring beans inside a cdi bean ? Thank you !
update
I've just tested the solution from this article, and so far it works fine, and i feel relieved.
Thank you !