I am using JQuery ajax in Spring MVC 3. When making the following call, I am running into a dilemma with myurl. On the local development machine, myurl would be localhost:8080/myapp/my_json_controller. On the production, my url would be domain/my_json_controller. I tried using relative url, /my_json_controller, and it would not work on the development machine because of the /myapp part. Any suggestion on how to make this work on both production and development? Thanks!
$.ajax({
url: myurl,
data: mydata,
dataType: 'json',
type: 'get',
cache: false,
success: function ()
});