I am using Spring MVC and Javascript / ajax . I have a problem with how my ajax scripts reference a server resource.
Let's say I have two pages that should use the same server resource through ajax:
URL for the first page:
/myapp/advertisement/28/edit/myapp/signup
Tell the server resource my ajax script should use:
/myapp/geolocation/addressAutocomplete
At the moment, I have a hard-coded path to the application context, i.e. /myapp in my ajax script.
If and when the path to the application context changes, I need to update all my scripts.
Is there a solution for this?
source share