1. 程式人生 > >接收前臺返回的Json格式引數

接收前臺返回的Json格式引數

public void add(HttpServletRequest request){
        String content = this.getRequestContent(request);
        if(StringUtils.isBlank(content)){
            ...
        }
        JSONObject obj =null;
        try {
            obj = JSONObject.fromObject(content);
        } catch (Exception e) {
            e.printStackTrace();
            Log.info("引數格式有誤"
); } String font = JsonUtils.getJsonString(obj, "font",""); int maxFont = JsonUtils.getJsonRealInt(obj, "maxFont", 0); }