Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从jquery jtable向spring应用程序发送请求_Jquery_Spring Mvc_Jtable - Fatal编程技术网

如何从jquery jtable向spring应用程序发送请求

如何从jquery jtable向spring应用程序发送请求,jquery,spring-mvc,jtable,Jquery,Spring Mvc,Jtable,这是控制器: @RequestMapping(value = "saveDetails", method = RequestMethod.POST) public ModelAndView saveDetails(@ModelAttribute("checkPointDetailsBean") CheckPointDetailsBean checkPointDetailsBean, BindingResult bindingResult) throws ParseException

这是控制器:

  @RequestMapping(value = "saveDetails", method = RequestMethod.POST)
    public ModelAndView saveDetails(@ModelAttribute("checkPointDetailsBean") CheckPointDetailsBean checkPointDetailsBean, BindingResult bindingResult) throws ParseException {


    System.out.println("ggggggg");

    String statusMsg = null;
    JSONObject objmJSONObject = new JSONObject();
    try {

        statusMsg = checkPointDetailsBo.saveDetails(checkPointDetailsBean);
        if ("Success".equals(statusMsg)) {
            objmJSONObject = getJSONObject(true, statusMsg);
        } else {
            statusMsg = bindingResult.getNestedPath().concat("savingFailed");
            objmJSONObject = getJSONObject(false, statusMsg);
        }
    } catch (Exception e) {

        statusMsg = bindingResult.getNestedPath().concat("savingFailed");
        objmJSONObject = getJSONObject(false, statusMsg);
    }

    ModelAndView mv = new ModelAndView("orgnizationTree");
    mv.addObject("orgnizationTree", objmJSONObject);

    return mv;
}

private JSONObject getJSONObject(boolean status, String useMaessage) {

    JSONObject objmStatusObject = new JSONObject();
    JSONObject objmErrorMessageObject = null;
    if (status) {
        objmStatusObject.put("success", status);
        objmErrorMessageObject = new JSONObject();
        objmErrorMessageObject.put("reason", useMaessage);
        objmStatusObject.accumulate("errors", objmErrorMessageObject);
    } else {
        objmStatusObject.put("success", false);
        objmErrorMessageObject = new JSONObject();
        objmErrorMessageObject.put("reason", useMaessage);
        objmStatusObject.accumulate("errors", objmErrorMessageObject);
    }

    return objmStatusObject;
}
这是我的js:

$(document).ready(function() {
    $('#CPValueTableContainer').jtable({
        title : 'CheckPointValue List',
                     selecting: "true",
                     selectingCheckboxes: "true",
                     multiselect:"true",
                     type: 'GET',
                     dataType: 'json',
        actions : {
            listAction : 'Controller?action=list',
            createAction : 'saveDetails',
            updateAction : 'Controller?action=update',
            deleteAction : 'Controller?action=delete'
        },
        fields : {
            checkPointValue : {
                title : 'CheckPointValue',
                width : '30%',
                key : true,
                list : true,
                edit : false,
                create : true
            }
        }
    });
    $('#CPValueTableContainer').jtable('load');
});