I want to make all beans request scoped by default, however the Spring documentation says that the default scope is Singleton. (sections 3.4.1 and 3.4.2 http://static.springsource.org/spring/docs/2.5.x/reference/beans.html)
I want to declare the default scope to be request scoped.
This is the closest thing I have found so far -- it's a defect that has not been touched in some time. jira.springframework.org/browse/SPR-4994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel#issue-tabs
There is no default-scope Attribute defined in spring-beans.xsd file. But according To BeanDefinition API
And WebApplicationContext - A extended ApplicationContext supports request scope
So just make sense To use request scope when you have a WebApplicationContext. And if you want To register of all beans defined in WebApplicationContext as request scoped, you must define a BeanFactoryPostProcessor
And do not forget register your BeanFactoryPostProcessor
But keep in mind
So The BeanFactoryPostProcessor defined above just overrides scope property whether your bean is defined in your WebApplicationContext
UPDATE
Again you should use The same BeanFactoryPostProcessor provided above. I am not sure but I Think The only way you can set up its scope is by using beanDefinition.setScope method. And There is a lot of useful methods you can retrieve information about any bean. See ConfigurableListableBeanFactory such as
...
I hope It can be useful