Loading
Read Message Sources with Spring Application Context.

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  How you create Singleton beans by using Spring ?


Ans)

In Spring Beans are defined two modes: singleton or non-singleton.
When a bean is a singleton, only one shared instance of the bean will be managed and all
requests for beans with an id matching that bean definition will result in that one
pecific bean instance being returned.

Beans are deployed in singleton mode by default, unless you specify otherwise.

Please see below you could manage this feature with  'singleton' attribute, please see below.

<bean name="yetAnotherExample"
      class="examples.ExampleBeanTwo" singleton="true"/>



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

Read Message Sources with Spring Application Context.


Read Message Sources with Spring Application Context.

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free