Announcement Announcement Module
Collapse
No announcement yet.
Can prototype beans be defined using Java based configuration ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can prototype beans be defined using Java based configuration ?

    Simple question, can it be done ?

    Normally with Java based Spring configuration a method defined with @bean returns a new instance of the bean in question, but a prototype bean is different as it's effectively a template for an object rather than something that returns the actual object.
    Last edited by Paul Newport; Aug 9th, 2012, 04:42 AM.

  • #2
    Yes... The java methods for java config are basically factory methods simply use the @Scope to define it as prototype.

    Comment

    Working...
    X