0
I know that the issue has been commented on numerous times in various blogs and forums around the world, but I really do not know what may be causing, because I think that in setting up my project is all ok:
pages *.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<html>
<head>
<meta charset="utf-8">
<title>JooceBox v1.0</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
web xml.
<filter>
<filter-name>SetCharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>SetCharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
I also set as parameter in the connection to the database itself:
<property name="url" value="jdbc:mysql://localhost:3306/viatgedb?useUnicode=yes&characterEncoding=UTF-8"/>
Even with such settings when I will save some record with accents the same stays as follows:
'Joã£o Manuel', 'Heartthrob Bonin''
Ever tried to use
ISO 8859-1
?– Edi. Gomes
Hi @Edi.Gomes already tried, but without success
– João Manolo
It should work with all this. But make sure your table in the database is like
UTF-8
also. If you log the data into the persistence layer, the accents are correct or not. It is very important to isolate the problems before any attempt, that is, whether it occurs in HTTP interpretation or in communication with BD.– utluiz