Problems encountered: The fastJson utility class will have List< installed; HashMap> When converted to a JSONArray, the key with null value in the HashMap is also lost. Code:
JSONArray dataArray=JSONArray.parseArray(JSON.toJSONString(datalist))
Solutions:
JSONArray dataArray=JSONArray.parseArray(JSON.toJSONString(datalist,SerializerFeature.WriteMapNullValue))
div>
Read More:
- SqlNullValueException: Data is Null. This method or property cannot be called on Null values.
- Using global timing task cronutil in hutool tool class
- Unit Android converts c# class to JSON file and reports an error
- Could not write JSON: write javaBean error, fastjson version x.x.x, class
- org.apache.ibatis.type.TypeException: Error setting non null for parameter #4 with JdbcType null
- Use of HQL query.list () is a null pointer exception, but the database can find out the result
- sqoop-import ERROR tool.ImportTool: Import failed: No primary key could be found for table user_info
- Error in installing pywin32 under Windows: close failed in file object D estructor:sys.excepthook is missing lost sys.stderr
- com.alibaba.fastjson .JSONException: For input string: “3000-01-01” or “9999-12-31”
- JSON and map convert to each other (using fastjson)
- IntelliJ idea class is normal, but error is marked in red and cannot be found
- An error is reported when installing the package directly in pycharm, but it can be installed through the terminal. Error non zero exit code (2)
- Springboot integration redis reports non null key required (solved)
- The reason why HashMap multithreads send out life and death loops
- PackageNotInstalledError: Package is not installed in prefix
- #error identifier-list parameters may only be used in a function definition
- How to Fix “the data of store is lost after Vue refreshes the page”
- 【PTA:】 Error: class X is public should be declared in a file named X.java
- The @ Autowired annotation in springboot is invalid in ordinary classes. How to solve and use the null pointer exception java.lang.nullpointerexception
- ERROR 1048 (23000): Column ‘courseno‘ cannot be null