title: Write java code in js file
body: <p>I want to access a system property from my <code>.js file</code>.
  Initially I had accessed the system property from my jsp file using the below syntax which worked just fine:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
   function ChatWindow(){
          var property = "&lt;%=System.getProperty("CHAT_WINDOW_URL") %&gt;";
          alert(property);
      }
      &lt;/script&gt;
  </code></pre>
  
  <p>However when I tried to use the same function in <code>.js file</code>, I am getting errors that :</p>
  
  <pre><code>Expected ';'
  </code></pre>
  
  <p>When I do add <code>';'</code> as follows: </p>
  
  <pre><code>var property = "&lt;%=System.getProperty("CHAT_WINDOW_URL"); %&gt;";
  </code></pre>
  
  <p>or as</p>
  
  <pre><code>var property = "&lt;%=System.getProperty('CHAT_WINDOW_URL') %&gt;";
  </code></pre>
  
  <p>The error goes.. but the property value is not resolved.
  Could anybody please help me on this.</p>