title: Load an external properties file in grails
body: <p>I am trying to load the properties file externally, by setting up the system environment.</p>
  
  <p>In my config.groovy file, </p>
  
  <pre><code>  println "Config file location ---&gt;" + System.getenv("SAM_ENV")
    grails.config.locations = ["file:"+ System.getenv("SAM_ENV")]
  </code></pre>
  
  <p>I have set the system env SAM_ENV value as C:\test\config.properties.</p>
  
  <p>When I try to run the application,I am getting the print value as</p>
  
  <pre><code>     Config file location ---&gt; C:\test\config.properties prints properly.
  </code></pre>
  
  <p>The problem is when I try to access the properties file in my controller as </p>
  
  <pre><code>        print "PAGINATION1"+grailsApplication.config.PAGINATION1
  </code></pre>
  
  <p>the value of PAGINATION1 is not getting printed properly.</p>
  
  <p>Can any one help me what configuration has to be done to access the external properties file in grails application.</p>