There is a Spring + Hibernate + DerbyDB application. TomCat server 8.0.32. The problem with the encoding of Russian characters when storing data in the database. Data leaves the form and is stored in ISO-8859-1 encoding. The application has UTF-8 encoding installed, and all .jsp files are also created in UTF-8. If you create an entry in the database without an application (directly, for example through the console), Russian-language characters are displayed correctly. TomCat added the parameter URIEncoding = "UTF-8" to the server.xml file of the TomCat, it did not help, the data is still saved in an incorrect encoding. Please tell me what could be the problem?

    1 answer 1

    It is not clear what “ UTF-8 encoding is installed in the application ”, this should be done on all JSP pages:

     <%@ page contentType="text/html; charset=UTF-8" %> 

    Also try adding a web filter that does the following:

     public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException { request.setCharacterEncoding("UTF-8"); chain.doFilter(request, response); }