title: How to create a list of values inside application.properties file and how to retrieve that list inside controller class using springboot
body: <p>My requirement is to create a list of values inside application.properties file.</p>
  <pre><code>com.mail = aaaa, bbbb, cccc 
  </code></pre>
  <p>I want to retrieve these values in my controller class and iterator over each value and should check with the requestbody/queryparam values which gets, when hitting an API</p>
  <p>Consider I have an API</p>
  <pre><code>@RestController
  @RequestMapping(&quot;/response&quot;)
  public class HomeController {
  @PostMapping(&quot;/postbody&quot;)
  public String postBody(@RequestBody String fullName) {
     //here I have to validate the fullName with the list I created in the application.properties
  Eg: if(fullname.equals(aaaa) or if(fullname.equals(bbbb) or if(fullname.equals(cccc)
  // I want to iterator over the list to check any value is matching with fullName.
  }}
  </code></pre>
  <p><strong>How to declare list of values inside application.properties? How to retrieve that list inside controller class? Post retrieving how to iterate over the list to check whether it matches with requestbody/queryparam value?</strong></p>
  <p>Please provide me with solution. Thank you</p>