I am developing a RESTFul web service project that has a POJO as shown below:
@XmlRootElement public class Input {
My ajax is called on this button:
<button type="submit" onClick='functionname();' class="btn btn-primary" ><span class="glyphicon glyphicon-lock"></span>Function</button>
The Controller class I have the following:
@Path("/input") public class InputResponse { InputService inputservice = new InputService(); @PUT @Path("/approve") @Produces(MediaType.APPLICATION_JSON) public void approveInputRecord(Input obj) throws Exception{ String LR = obj.getLR(); double CSH = obj.getCSH(); double ECH = obj.getECH(); String APP = obj.getAPP(); Input input = new Input(LR,CSH,ECH,APP); input = inputservice.approveTransaction(input); } }
The Service class for the same type:
public class InputService { CallableStatement stmt; Statement commitStmt; public InputService(){
Inside my JAVA Script my ajax call is above:
var obj = { LogReference : logreference, EuroclearHoldings:euroclearholdings, ClearstreamHoldings:clearstreamholdings, Approver : loginXPID } var jsonobj = JSON.stringify(obj); $.ajax({ url:'./webapi/input/approve', type: 'PUT', data:jsonobj, cache:false, contentType: 'application/json', dataType:'json', success:function(data) { alert('success'); }, error:function(xhr,textstatus,errorthrown){ alert(xhr.responseText); alert(textstatus); alert(errorthrown); } },'json');
Having this as my code, my application works fine on Google Chrome , but sometimes it works, and sometimes not on Internet Explorer 11 . This is a weird behavior. And the other thing that I canโt get, even if it works on Chrome , the ajax call always gets error alerts by error. Can someone explain why this is so? And how to solve it? Any help is greatly appreciated. Update
Here is the output on the network --> Response tab on chrome on error. But despite this, I am still getting a way out. 
Thank you very much