Announcement Announcement Module
Collapse
No announcement yet.
when can the isSingleton() and isPrototype() methods both return false? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • when can the isSingleton() and isPrototype() methods both return false?

    Hi I got this question in exam can any one please answer it ?

    For a given Spring-managed bean, when can the isSingleton() and isPrototype() methods both return false?

    options are
    a>When only one request has been made for the bean
    b>When a FactoryBean is being used to manage the bean
    c>When a bean is configured for singleton, but an external reference is being held to the bean
    d>When the bean is configured for lazy-loading and has not yet been initialized
    e>When the bean's scope is "request"

  • #2
    Well the answer is quite simple actually...when the bean in question is scoped neither as prototype nor as singleton, so it is a request, session or global session bean (or a bean with a user-defined custom scope). So the right answer is E.

    Comment

    Working...
    X