JQuery发送ajax报告时出现问题

时间:2017-11-13 16:50:26

标签: javascript jquery ajax spring

我正在尝试使用此脚本发送报告:

$(".saveButton").on("click", function(){
 var setting = {
    'propertyName' : "SomeName",
    'propertyValue' : $(this).parent().siblings('.inputCol').children('.inputField').val();
 };
 $.ajax({
    type: "Post",
    contentType: "application/json",
    url: "/settings/PropertyEdit",
    data: JSON.stringify(setting ),
    dataType: 'json',
    success: function (data) {
        //Do something
    }
});

以这种方式接收我的POST:

@Link(label = "Property Edit", family = "SettingsController", parent = "Settings")
@RequestMapping(value = "/settings/PropertyEdit", method = RequestMethod.POST)
public String atmPropertyEdit(Setting setting) {

     return "true";
}

但是我甚至可以停在我的断点(返回时)(Error 403 - no-referrer-when-downgrade),除非我将我的请求方法改为GET,否则它可以正常工作。

尝试过这个脚本 - 同样的403错误。

$.post('/atmsettings/atmPropertyEdit', { propertyName : "hello", propertyValue : "hello2"}, 
function(returnedData){
    console.log(returnedData);
});

0 个答案:

没有答案