L
L
Loligan2016-05-23 23:10:02
Java
Loligan, 2016-05-23 23:10:02

Does not write to the database and does not display Cyrillic on the pages. How to convert everything to UTF-8?

My whole project is in Spring. In general, it does not want to write Russian letters into the database (MySQL) (the problem is in classes and methods) and display Russian text on the pages. How to fix?
P,S, Maven is set to UTF-8.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Valera Programmer, 2016-05-24
@noddux

Try to put on the form (enctype="multipart/form-data")
or
Add to the method responsible for sending: produces = "text/plain;charset=UTF-8";
Example:
@RequestMapping(value = "/demo/send-text", produces = "text/plain;charset=UTF-8")

E
Eugene, 2016-05-24
@zolt85

If the application is running on Tomcat, add the URIEncoding="UTF-8" attribute to the Connector tag in server.xml. It should turn out something like this:

<Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" 
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8"/>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question