RooWebJson和KendoUI网格
我使用SpringRooJSON作为后端,为READ制作了KENDOUI网格 但是,对于CREATE,生成的响应是HTTPSTATUS.CREATED KENDOUI网格需要HTTPSTATUS.OK,响应正文为“null” 我通过推入roo生成的代码来验证这一点,并做了以下更改。成功了 JSON.aj代码RooWebJson和KendoUI网格,json,kendo-ui,kendo-grid,spring-roo,flexjson,Json,Kendo Ui,Kendo Grid,Spring Roo,Flexjson,我使用SpringRooJSON作为后端,为READ制作了KENDOUI网格 但是,对于CREATE,生成的响应是HTTPSTATUS.CREATED KENDOUI网格需要HTTPSTATUS.OK,响应正文为“null” 我通过推入roo生成的代码来验证这一点,并做了以下更改。成功了 JSON.aj代码 HttpHeaders headers = new HttpHeaders(); headers.add("Content-Type", "application/json"
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
return new ResponseEntity<String>(headers, HttpStatus.CREATED);
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
return new ResponseEntity<String>("null", headers, HttpStatus.OK);
HttpHeaders=newhttpheaders();
添加(“内容类型”、“应用程序/json”);
返回新的ResponseEntity(标题,HttpStatus.CREATED);
推入式代码
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
return new ResponseEntity<String>(headers, HttpStatus.CREATED);
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
return new ResponseEntity<String>("null", headers, HttpStatus.OK);
HttpHeaders=newhttpheaders();
添加(“内容类型”、“应用程序/json”);
返回新的ResponseEntity(“null”,标题,HttpStatus.OK);
问题:
有没有办法更改roo的json aj文件的默认响应
或
是否有办法处理KENDOUI中的其他HTTPSTATUS,以便将HTTPSTATUS.CREATED的响应视为成功
最后,KenoduiGrid似乎无法检测服务器何时遇到错误,因为即使是错误500也没有被捕获 关于Roo问题答案是否定的,您必须根据需要推入并自定义
请在处打开一个改进问题,创建响应应包含已创建的记录,且其ID已更新-如果不返回该记录,网格将继续将该记录发送到服务器进行创建 关于错误500代码-应触发数据源的错误事件,该事件应包含响应本身,以便您可以通知用户发生了什么错误