We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import javax.annotation.Resource; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class TestController { @RequestMapping(value = "/model") public Model model() { Model model = new Model(); model.setId(1); model.setEmoji("\uD83D\uDE33"); return model; } @RequestMapping(value = "/string") public String modelString() { Model model = new Model(); model.setId(1); model.setEmoji("\uD83D\uDE33"); return serialize(model); } @Resource private ObjectMapper objectMapper; <T> String serialize(T object) { try { return objectMapper.writeValueAsString(object); } catch (JsonProcessingException ex) { throw new RuntimeException(ex); } } }
{"id":1,"emoji":"\uD83D\uDE33"}
{"id":1,"emoji":"😳"}
why do we get diffent results?how to get the string() 's result in model()?
The text was updated successfully, but these errors were encountered:
The same as FasterXML/jackson-core#223
Sorry, something went wrong.
No branches or pull requests
0. at first
1.5.12
2.8.11
1.code
2. different results
3. question
why do we get diffent results?how to get the string() 's result in model()?
The text was updated successfully, but these errors were encountered: