Answer the question
In order to leave comments, you need to log in
Spring MVC, how to set default page encoding?
Hello :)
There is a REST API on Spring MVC (without Spring Boot if that matters).
Different points should return different MIME types (some JSON, some TEXT). In the case of JSON with Cyrillic, everything is fine, but "text" points return a page with ISO-... encoding and, accordingly, questions instead of Cyrillic.
Treated at the method annotation level, for example:
@DeleteMapping(value = "/employees/{id}", produces = "text/html; charset=utf-8")
// дальше сам метод
Answer the question
In order to leave comments, you need to log in
Good afternoon.
In general, this is not a crutch method, but very normal.
But if you want to add it globally, you can extend the AbstractHttpMessageConverter class
Here is a similar question on SO -
https://stackoverflow.com/questions/5019162/custom...
Here is another similar question:
https://stackoverflow.com/questions /5649329/utf-8-...
https://stackoverflow.com/questions/6638284/spring...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question