0

Possible Duplicate:
Controller's life-cycle in Spring MVC

I have a general question about controllers in spring mvc.
I have a controller class (annotated with the @Controller). Each time a request is sent to my server the controller catches the request (of course according to the request mapping).
My question is this. Does spring instantiate a new controller per request or dose spring handle the controllers as a singletone?

Roman Pokrovskij
  • 9,449
  • 21
  • 87
  • 142
Mr T.
  • 4,278
  • 9
  • 44
  • 61
  • As you see in the question [Controller's life-cycle in Spring MVC](http://stackoverflow.com/questions/1481993/controllers-life-cycle-in-spring-mvc) controllers in Spring 3 are ordinary beans, so they can be scoped as you want. Typically they're stateless, so default scope, which is singleton, is sufficent. – Grzegorz Rożniecki Sep 25 '12 at 17:29

1 Answers1

0

Controller Spring are beans. Bean are deployed in singleton mode by default, unless you specify otherwise. Instance of controllers will be created after start of web application context and disposed before end of it.

Reference: Spring Beans

Jhonathan
  • 1,611
  • 2
  • 13
  • 24