A
A
AlexanderMv2016-01-24 13:40:09
MySQL
AlexanderMv, 2016-01-24 13:40:09

How to set up the correct recording and display of Cyrillic in the browser (Mysql 5.5.46)?

Learned to cook: Spring 3 MVC + Spring Security + Hibernate from habrahabr.ru/post/111102/. The server started, but when adding records through the page localhost:8080/contactmanager/index I see kazibuki.
Output SHOW VARIABLES LIKE 'char%' :
4478f8a915324fb89e98b2f6a27b9ae9.png
Via phpMyAdmin Insert works fine
ab7f3549ea3e47328039dbd5e0ab8ca0.png
But in localhost:8080/contactmanager/index I see the following:
294841eac9f7489f80ec9278445f9d2d.png
And if I add this entry I get the
da4c30f2f762491f81b2389ea4fefd27.png
following:
1090e326450a4a5c96303f820fe78876.png
In my.cnf added:
[mysqld]
character-set-server= utf8
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'
Contents of jdbc.properties:
jdbc.driverClassName= com.mysql.jdbc.Driver
jdbc.dialect=org.hibernate.dialect.MySQLDialect
jdbc.databaseurl=jdbc:mysql://localhost:3306/contactmanager?characterEncoding=UTF-8
jdbc.username=contactmanager
jdbc.password=1234
Made changes to contact.jsp. Got this result - view-source: localhost:8080/contactmanager/index:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Менеджер контактов</title>
</head>
<body>

<a href="/contactmanager/logout">
  Выйти из приложения
</a>
  
<h2>Менеджер контактов</h2>

<form id="contact" action="add" method="post">

  <table>
    <tr>
      <td><label for="firstname">
        Имя
      </label></td>
      <td><input id="firstname" name="firstname" type="text" value=""/></td>
    </tr>
    <tr>
      <td><label for="lastname">
        Фамилия
      </label></td>
      <td><input id="lastname" name="lastname" type="text" value=""/></td>
    </tr>
    <tr>
      <td><label for="email">
        Email
      </label></td>
      <td><input id="email" name="email" type="text" value=""/></td>
    </tr>
    <tr>
      <td><label for="telephone">
        Телефон
      </label></td>
      <td><input id="telephone" name="telephone" type="text" value=""/></td>
    </tr>
    <tr>
      <td colspan="2"><input type="submit"
        value="Добавить контакт" /></td>
    </tr>
  </table>
</form>

<h3>Контакты</h3>

  <table class="data">
    <tr>
      <th>Имя</th>
      <th>Email</th>
      <th>Телефон</th>
      <th>&nbsp;</th>
    </tr>
    
      <tr>
        <td>, Вася</td>
        <td></td>
        <td></td>
        <td><a href="delete/1">Удалить</a></td>
      </tr>
    
      <tr>
        <td>, ÐаÑилий</td>
        <td></td>
        <td></td>
        <td><a href="delete/2">Удалить</a></td>
      </tr>
    
  </table>


</body>
</html>

Problem still exists. When adding an entry, I see kazibuki.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-01-24
@sim3x

Replace in template
on the
I looked at the
article - HELL, how people write in Java web I don’t understand
PS Add to the question under the spoiler the resulting page with krakozyabry
PPS: you can edit the question

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question