Close
« Tutorial

Spring MVC - Session Scoped Bean with Proxy MCQ

0/13
0 ✓
0 ✗

1. What does a session scoped bean mean in Spring?

2. How long does a session scoped bean live?

3. What happens when a new HTTP session starts?

4. Two different users are using the application with two different HTTP sessions. How do they work with a session scoped bean?

5. A user sends several requests using the same HTTP session. What happens to the data stored in a session scoped bean?

6. Which of these is a good use of a session scoped bean?

7. Why is a scoped proxy used when a session scoped bean is injected into a singleton bean, such as a controller?

8. What does the injected scoped proxy do when a method is called on it?

9. Which @Scope attribute is used to enable a scoped proxy for a bean?

10. Which proxyMode value tells Spring to create a class based proxy?

11. Which constant of WebApplicationContext represents the name of the session scope?

12. What is the effect of the following bean configuration?

@Component
@Scope(value = WebApplicationContext.SCOPE_SESSION,
       proxyMode = ScopedProxyMode.TARGET_CLASS)
public class UserCart {
}

13. When a class based proxy is used, what type can be used at the injection point?

14. Besides a scoped proxy, which approach can be used to get a session scoped bean inside a singleton bean?

Join