Differences between @VaadinSessionScope and @Scope("session")

I didn’t understand the difference between @VaadinSessionScope and @Scope(“session”).
What should I use ?
When ?
Tks

@VaadinSessionScope is tied to VaadinSession and @Scope(“session”) to HttpSession. These are in typical cases the equal by context and lifecycle. If you have multiple Vaadin servlets in your WAR, they share the same HttpSession, but each have their own VaadinSession. So in this kind of application it makes a difference.

Tks.
However I don’t understand, using spring integration (without Spring Boot) when a @Route is created which kinb of Spring bean is and its scope.
I tried to list all beans in my spring context and no bean corresponds to my @Route annotated class.
Tks
Tullio

Now I annotated my @Route as @VaadinSessionScope but I don’t see any session scoped bean.
If I try to annotate my @Route as @Scope(“session”) it’s not able to create the bean because session is not active in the thread.
Tks

If I try to annotate my @Route as @Scope(“session”) it’s not able to create the bean because session is not active in the thread.

Yes, there is a lifecycle mismatch, thus that is not possible.

Now I annotated my @Route as @VaadinSessionScope

Generally I would say that this is not a good practice.

If you want to share some VaadinSession scoped data in your views, I would advice to create separate class for that and annotate it @VaadinSessionScope and autowire the class in your view.

Do You mean is not possible to get session bean in a @Route even if I use the Vaadin Spring integration ?
In Vaadin 8 I didn’t find that problem.
It seems to me a big limitation.
I can’t annotate all my session bean as VaadinSessionScope because many of them are services in a layer which don’t know Vaadin.
Any suggestion ?
Tks