|
|
От: |
Pavel Dvorkin
|
|
| Дата: | 04.10.23 14:32 | ||
| Оценка: | 3 (1) | ||
Spring controllers are singletons (there is just one instance of each controller per web application) just like servlets.
Be aware that they'll only be singletons per context, and that it's entirely possible to have nested contexts when working with Spring web applications, and that by duplicating a package-scan you might end up with multiple instances of the same controller.