Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value\n at [Source: (org.apache.cxf.transport.http.AbstractHTTPDestination$1);


报错堆栈:

Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value\n at [Source: (org.apache.cxf.transport.http.AbstractHTTPDestination$1); line: 3, column: 34

报错原因:

字符串中包含换行 '\n'

解决办法:

1.在'\n'之前加转义符号'\';

2.ObjectMapper MAPPER = new ObjectMapper();给MAPPER设置一个属性 MAPPER.configure(com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true);


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM