Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

How can we inject a Java Collection in Spring framework?

Pragya Keshap answered on February 10, 2023 Popularity 2/10 Helpfulness 1/10

Contents


More Related Answers

  • how to collect objective in java
  • class property java
  • declaring collection java
  • java collection
  • Java Collections Framework
  • Java Collection Interface
  • collection programs in java
  • Java Collection Interface
  • What are the main benefits of Collections Framework in Java?
  • How can you make a Collection class read Only in Java?
  • What are the different types of collections in Java?

  • How can we inject a Java Collection in Spring framework?

    0

    Spring promotes Dependency Injection (DI) in code. It gives

    support for injecting not only objects but also collection of objects.

    We can inject collections like- list, set, map etc. in Spring.

    Following tags can be used for this purpose:

    : This type is used for injecting a list of values. In a

    duplicates are allowed.

    : This type is used for injecting a set of values. As per set

    property, duplicates are not allowed.

    : This type is used for injecting name-value pairs in form of

    map. Name and value can be of any type that is allowed for a map.

    : This type is used to inject a collection of String based

    name-value. It is like a properties file.

    https://www.baeldung.com/spring-injecting-collections

    Popularity 2/10 Helpfulness 1/10 Language java
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Feb 10 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.