Spring MVC中,在controller层使用ResponseBody返回json时,我这里使用的是jackson。
在使用ResponseBody注解时,返回的对象中,有的字段为空,如果想字段为空时,或者字段为默认值时,不返回该字段。有一下三种…
public class Solution {// 子环节,归并两个有序的数组public void MergeSort(int[] arr, int left, int mid, int right){int[] arr2 new int[mid - left 1];int[] arr3 new int[right - mid];int length1 mid - left 1;int length2 right - mid;for(int i …