ajax json object is to pass parameters to obtain background

 

var data = {data:{name:'pxxx',
                    paramData:[{dataSource:'a1',table:'t1',field:'f1','r':[{name1:"01",p:''},{name2:"02",p:'10,100'},{name2:"01",p:''}]},
                        {dataSource:'a2',table:'t2',field:'f2','r':[{name1:"01",p:''},{name2:"02",p:'10,100'},{name3:"01",p:''}]}]
                }};
$.ajax({
    type:"POST",
    async:false,
    dataType:'json',
    contentType : "application/json",
    url:"matePxxx/addPxx",
    data: JSON.stringify(data),
    success:function (data) {

            }
});

@RequestMapping("/addPxx")
@ResponseBody
public Map<String,Boolean> addPxxx(@RequestBody JSONObject data){
   System.out.println(data);
  return map;
}
$.ajax({
                                                type:"post",
                                                dataType:"json",
                                                url:"DataSourceCheck/refreshDataSource",
                                                data:{dataSourceId:dsId},
                                                success: function(data){
                                                    
                                                }
                                            });

@RequestMapping("refreshDataSource")
    @ResponseBody
    public boolean refreshDataAction(String dataSourceId){
        return true;
    }

 

Intelligent Recommendation

Node.js --- Ajax way to pass parameters to the background

html code: Background configuration routing codes: When you click the search button, the effect is as...

JavaScript uses ajax to pass parameters to the background

When using ajax to pass parameters, there will often be situations where the background cannot accept the parameters. The solution is as follows front end: Get the parameters passed by ajax in the bac...

jQuery ajax pass json array to the background

jQuery ajax pass json array to the background The front end code is as follows: Background code: Here is the params, which is data:{params:JSON.stringify(arr)}. The key of the aqx passed in the parame...

SpringMvc in the foreground ajax pass json data background controller accept object is null

Recently, when using Ajax to pass the JSON format array to the controller layer, there is a problem with null. For details, please refer to   Finally, add a small supplement, after the data is pa...

Spring AVC uses Ajax POST request to pass parameters in json format. The server cannot obtain the parameter value through request.getParameter ("name")

Article Directory 1. Demo demo 1. JS request code at the front desk (pseudo code) 2. Background code (pseudo code) Second, the problem analysis Third, the solution 1. [Foreground Solution] Modify the ...

More Recommendation

Ajax sends request (object) to pass parameters

Take the value in the background and convert the passed json object into an object entity class User user = (User) JSONObject.toBean(JSONObject.fromObject(request.getParameter("user")), User...

Ext ajax and struts pass json object instance

  Ext javascript code:       Struts configuration file:       Strut java code:   Attribute in class     This allows struts to receive json objects. &n...

Ajax pass parameter json object to servlet to get

JSP login interface code: The corresponding code snippet of the servlet corresponding ajax value:  ...

Ajax pass the array to the background, the background Spring MVC accepts an array of parameters

The front end of the following code, passing an array, receiving background List <String>: Background code as follows: There are two points to note: Use annotations@RequestParam Parameter values...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top