title: Accessing multiple property files with @PropertyResource in Spring
body: <p>Using the new <code>@PropertySource</code> annotation in Spring 3.1, how can you access multiple property files with Environment?</p>
  
  <p>Currently I have:</p>
  
  <pre><code>@Controller
  @Configuration 
  @PropertySource(
      name = "props",
      value = { "classpath:File1.properties", "classpath:File2.properties" })
  public class TestDetailsController {
  
  
  @Autowired
  private Environment env;
  /**
   * Simply selects the home view to render by returning its name.
   */
  @RequestMapping(value = "/", method = RequestMethod.GET)
  public String home(Locale locale, Model model) {
  
      String file1Name = env.getProperty("file1.name","file1.name not found");
              String file2Name = env.getProperty("file2.name","file2.name not found");
  
              System.out.println("file 1: " + file1Name);
              System.out.println("file 2: " + file2Name);
  
      return "home";
  }
  </code></pre>
  
  <p><br>
  The result is the correct file name from <em>File1.properties</em>, but <em>file2.name</em> not found. How can access <em>File2.properties</em>?</p>