How to let jackson generate json string using single quote or no quotes?
问题 For example, I want to generate a json string for ng-style : <th ng-style="{width:247}" data-field="code">Code</th> But with jackson, the result is: <th ng-style="{"width":247}" data-field="code">Code</th> It's not easy to read. So I want jackson to generate the json string with single quote or no quotes. Is it possible to do this? 回答1: If you have control over the ObjectMapper instance, then configure it to handle and generate JSON the way you want: final ObjectMapper mapper = new