1

I have a question that, i have a spring-mvc based project which is accessible by multiple user. My question is that when more than one user access that application then for each user there is separate controller class object or all user access the same controller class object.

2 Answers2

1

There will be multiple controller instances for different requests.

Please read: http://docs.spring.io/spring-framework/docs/2.5.x/reference/mvc.html

Related answer: How does Spring MVC handle multiple users

Community
  • 1
  • 1
user1933888
  • 2,897
  • 3
  • 27
  • 36
1

If the controller is a bean (which is the usual case) then the default is one bean per Spring container context.

If you set the controller/bean to scope=prototype then you would get a new instance from the factory each time.

Lee
  • 738
  • 3
  • 13