У меня проблема с отправкой умлаутов в Spring API. Я хочу опубликовать следующий JSON:
{
"username": "testümlaut",
"firstName": "test",
"lastName": "Test"
}
для этого у меня есть следующий метод start:
@RequestMapping(value="/User", method=RequestMethod.POST,
produces={"application/json ; charset=utf-8"}
)
@ResponseStatus(HttpStatus.CREATED)
public @ResponseBody User postUser(@RequestBody User user) {
User user = userDao.addUser(user);
return user;
}
Как видите, у меня есть строка:
produces={"application/json ; charset=utf-8"}
но это не помогает. Я всегда получаю исключение (0xfc — это ü):
Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Invalid UTF-8 start byte 0xfc
at [Source: java.io.PushbackInputStream@721e5ed1; line: 2, column: 19] (through reference chain: de.escosautomation.restserver.model.user.UserClone["username"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Invalid UTF-8 start byte 0xfc
at [Source: java.io.PushbackInputStream@721e5ed1; line: 2, column: 19] (through reference chain: de.escosautomation.restserver.model.user.UserClone["username"])
Что я могу добавить, чтобы заставить его работать?
Спасибо.