Spring 3.0 making JSON response using jackson message converter

后端 未结 8 2031
迷失自我
迷失自我 2020-12-01 05:20

i configure my messageconverter as Jackson\'s then

class Foo{int x; int y}

and in controller

@ResponseBody
public Foo metho         


        
8条回答
  •  孤街浪徒
    2020-12-01 06:06

    This is just a guess, but by default Jackson only auto-detects public fields (and public getters; but all setters regardless of visibility). It is possible to configure this (with version 1.5) to also auto-detect private fields if that is desired (see here for details).

提交回复
热议问题