Не знаю что

This commit is contained in:
2024-01-03 01:24:04 +06:00
parent 6df92f2e04
commit 98faea2e35
9 changed files with 19 additions and 49 deletions

View File

@ -99,15 +99,15 @@ public class DBMSRecords implements ServletContextAware {
public String sendError(int code, String message) {
JSONObject json = new JSONObject();
json.put("errorCode",code);
json.put("errorMessage",message);
json.put("error_code",code);
json.put("error_message",message);
return json.toString();
}
//Документация по @RequestBody http://javastudy.ru/spring-mvc/json-xml/ application/xml
@RequestMapping(value = "/records.php",method = {RequestMethod.POST,RequestMethod.GET},produces = "text/plain; charset=utf-8")
@RequestMapping(value = "/monitoring/records.php",method = {RequestMethod.POST,RequestMethod.GET},produces = "text/plain; charset=utf-8")
@ResponseBody
public Object ajaxTamer(@ModelAttribute User user,@RequestBody byte[] reqData,@RequestParam(required=false,name="lng") String language_id) {
public Object ajaxTamer(@ModelAttribute User user,@RequestBody(required = false) byte[] reqData,@RequestParam(required=false,name="lng") String language_id) {
if(language_id!=null && !language_id.equals(""))
user.language_id=language_id;
@ -115,6 +115,9 @@ public class DBMSRecords implements ServletContextAware {
boolean error=false;
String result=sendError(1,"Request not processed!");
if(reqData==null)
return result;
//response.setCharacterEncoding("UTF-8");
//response.getWriter().append("Served at: ").append(request.getContextPath());