I am studying Spring MVC and I have the following doubts:
- What exactly is the purpose of the session scope?
Reading the documentation I know that this scopes a bean definition to an HTTP session. Only valid in the context of a web-aware Spring ApplicationContext. And also that a new instance is created once per user session.
But when exactly is it used? and for what purpose? Can you make a practical example?
- In Spring MVC what is the default scope in the web context?
I know that in Spring the default scope for a bean is singleton but what about the scope of a bean in the web context?