I am studying CDI by reading through Weld - JSR-299 Reference Implementation
on docs.jboss.org. There is a translator example
on chapter 7. In the TranslatorControllerBean.java, there are 3 annotation: @Stateful
@RequestScoped
@Named(translator
)
How does @Stateful and @RequestScoped work on the same bean ? As I realized, Steteful session bean lives for multiple requests until a method annotated @Remove is called, on the other hand,RequestScoped bean is instantiated for every request.
This was recently answered in the seam 3 forum
http://sfwk.org/Community/LifecyclescopeOfStatefulSessionBeans