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.
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
Contents-scripts.js
$.getJSON('<app-url>/doSomething/getresult.htm', function(responseJson) {
$.each(responseJson, function(index, item) {
..
..
..
}
}
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