Engineering With Java

Engineering With Java

Spring Boot Quiz - Is a @RestController singleton by default?

Suraj Mishra's avatar
Suraj Mishra
Aug 24, 2025
∙ Paid

Question

A. Yes, one per request

B. Yes, it’s a singleton

C. No, it’s prototype scoped

D. Depends on the HTTP method

Share

Answer

B. Yes, it's a singleton

Spring Controller Lifecycle

Spring controllers annotated with @RestController (or @Controller) are singleton beans by default. This means:

  • One instance of the controller is created per application context

  • All requests

User's avatar

Continue reading this post for free, courtesy of Suraj Mishra.

Or purchase a paid subscription.
© 2026 Suraj Mishra · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture