前端js
var jsonRoots={"roots":roots} ;
alert("roots"+JSON.stringify(roots))
$.ajaxSetup({
contentType : 'application/json'
}); alert("ff"+JSON.stringify(data1))
$.post('componentTypeCategoryController.do?updateDragTree&entity='+data1,JSON.stringify(jsonRoots),function(){
alert("成功: "+result)
});
springmvc-xml 加入以下配置
服务器端:
/**
* tree 拖拽后的数据
* @return
*/
@RequestMapping(params = “updateDragTree” ,method =RequestMethod.POST ,produces = { MediaType.APPLICATION_JSON_VALUE },consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public void updateDragTree(HttpServletResponse response,HttpServletRequest request,@RequestBody Map