I have spring beans services defined in xml which are singleton. They take a long time to load. What i want a configuration(may be in XML or property file) where i can make all beans as prototype by default based on that configuration/property so that they can load faster.
Is there any configuration like this in spring ?
It looks like you could implement something like this by creating an instance of BeanFactoryPostProcessor as described here: https://dzone.com/articles/changing-default-spring-bean
In that implementation, any beans without an explicit scope would be have prototype scope.
This is similar to this approah (almost a duplicate of your question) How to specify the default scope in Spring's applicationContext.xml to request scope?
Note the caveats in that post, however, that this approach does not consider ancestor factories, which may or may not be a consideration in your case.
Load it in Servlet Context in XML configuration, that may help you to speed up singleton object creation, as per my opinion.