I am following this tutorial.
It uses @Scope("session")
and @SessionScoped
in different implementations.
What are the differences?
I am following this tutorial.
It uses @Scope("session")
and @SessionScoped
in different implementations.
What are the differences?
It is actually explained in the tutorial:
Mixed use of both JSF and Spring annotations are working fine, but it look weird and duplicated – @Component and @ManagedBean together. Actually, you can just uses a single @Component, see following new version, it’s pure Spring, and it works!
So the @SessionScoped
is the JSF solution. And @Scope("session")
is the pure Spring solution.
Using the @SessionScoped
will make your application more portable, when for example you want to switch to Java EE. However using Spring-DI gives you a more consistent implementation.