This website is built using SpringBoot. The URL for the HTML page is . Here is a segment of JavaScript code found on the index page:
$(function(){
jQuery.ajax({
contentType:'application/json;charset=UTF-8',
type: "POST",
url: "getSignTypes",
cache: false,
dataType: "json",
success:function(data){
if(data !== 'NA'){
console.log(data);
$('#signType').combobox({
valueField:'id',
textField:'title',
editable:false,
data:data,
value:data[0].id
});
}
},
error:function(msg){
console.log(msg)
}
});
})
I have noticed that I am using a relative path in the URL parameter of this ajax request. After testing it locally, I realized that the relative URL should be converted to , and indeed it works as expected when accessed from http://localhost:8088/trex/index/getSignTypes.
However, upon deploying it to the UAT environment, I observed that the URL gets converted to with the 'index' part missing. Why does a relative path in Ajax behave differently in different environments even though the code remains unchanged? Are there any pointers I can follow to identify the discrepancies? Thanks in advance.
I have attached a screenshot of the issue encountered in the UAT environment: https://i.sstatic.net/QOM5a.png