When sending a POST request from the jsp page to the controller, the data that is entered in Russian or Ukrainian is displayed as a string
I have already reviewed all the solutions to the problem, but nothing helps. Initially I thought it was a problem in the database, but no.
I did everything as it was written on the Internet:
since by using tomkat I have prescribed a URI encoding
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8" useBodyEncodingForURI="UTF-8" />page encoding:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>- Meta tag:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> in config class added:
private static final String VIEW_RESOLVER_CONTENT_TYPE = "text/html;charset=UTF-8"; viewResolver.setContentType(VIEW_RESOLVER_CONTENT_TYPE);`Since the configuration is set programmatically, I added web.xml and there I registered the jsp configuration
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <page-encoding>UTF-8</page-encoding> </jsp-property-group> </jsp-config>`
But nothing that I did did not help me.
@RequestMapping(value = "/user/register", method = RequestMethod.POST) public String createNewUser( @Valid @ModelAttribute("user") RegistrationForm userAccountData, BindingResult result, WebRequest request) throws DuplicateEmailException { }How to@RequestMapping(value = "/user/register", method = RequestMethod.POST) public String createNewUser( @Valid @ModelAttribute("user") RegistrationForm userAccountData, BindingResult result, WebRequest request) throws DuplicateEmailException { }it in my method? Or is it better to do it in the interceptor? - Andriy Dzigar