Results 1 to 2 of 2

Thread: Can prototype beans be defined using Java based configuration ?

  1. #1
    Join Date
    Sep 2004
    Posts
    602

    Default 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 at 03:42 AM.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    Yes... The java methods for java config are basically factory methods simply use the @Scope to define it as prototype.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •