How to serialize a java.util.List to Json using Gson Library?

前端 未结 2 982
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-21 23:56

In my servlet I have the following code:

    response.setContentType(\"application/json\");//set json content type
    PrintWriter out = response.getWriter();

          


        
2条回答
  •  旧时难觅i
    2021-01-22 00:26

    StackOverflowException occurs due to infinite recursion. You may need to check the code thoroughly for any unintended recursion.

提交回复
热议问题