title: Application URL in .js files
body: <p>I am a beginner with spring and am trying to do ajax calls to refresh pages when button is clicked.If i deploy the application with different names in tomcat , will it be possible to pass the application context  to the js file from jsp. </p>
  
  <p>The jsp does ajax calls to a jquery methods in a script.js file to be reused.
  the url in json method will return the result using requestmapping</p>
  
  <p>Contents-scripts.js </p>
  
  <pre><code>    $.getJSON('&lt;app-url&gt;/doSomething/getresult.htm', function(responseJson) {
  
      $.each(responseJson, function(index, item) {
  ..
  ..
  ..
  }
  }
  </code></pre>
  
  <p>I have read about base tag to have the app-url as global , is there any other way to pass app-url to .js files either as parameter or can a EL call like ${pageContext.request.contextPath} be done from .js files</p>