Lisa schrieb: > As I understand it a managed-bean that is request scope will get instantiated > each time (a request is submitted) and then destroyed (or sent for garbage > collection) after the response. > > I put some print statements in the no arg constructor and see that it is > instantiated (and all setters called with Spring injection) the first time > the page is requested, but then when I hit other buttons on the page > (subsequent requests), I do not see the bean re-instantiated (and setters > called) etc. > > any ideas? I have seen some beans that get instantiated on every request, > but the few that I am working with don't. I have checked my config file and > it is indeed in "request" scope. > > It acts like it is in session scope or something. I should see the no-arg > constructor called each time for a request. > You savestate those beans, right?
If the bean is safestated I am not sure if the constructor is called at all, because it is just deserialized. It basically saves the bean and a copy of the bean is placed after the request back into memory, hence I do not think the constructor of those beans is called, why it still is there. Savestate is very similar to a limited scope bigger than request but smaller than session. (similar to the Rails flash scope in many aspects)

