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

前端 未结 2 981
佛祖请我去吃肉
佛祖请我去吃肉 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条回答
  • 2021-01-22 00:26

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

    0 讨论(0)
  • 2021-01-22 00:32

    Looks like your Gps objects contain references to themselves.

    0 讨论(0)
提交回复
热议问题