1

Al incluir el multiidioma en mi web con Spring MVC definiendo los mensajes en un .properties

  • mensaje.planificaciones = Plannings,
  • mensaje.seguimientos = Tracing
  • mensaje.administradores = Administrators
  • mensaje.usuarios = Users

Al añadir estos mensajes al html no se reconocen las tildes ni las ñ, con th:text="#{mensaje.planificaciones}", ¿cómo puedo hacerlo?

<!DOCTYPE html>
<html lang="es" xmlns:th="http://www.thymeleaf.org">
<head>

<title></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-escale=1">

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
    integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
    crossorigin="anonymous"></script>
<script
    src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
    integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
    crossorigin="anonymous"></script>
<script
    src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
    integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
    crossorigin="anonymous"></script>
<!-- Custom styles for this template-->
<!--  <link href="/planiDeport-1/src/main/resources/templates/administrador/css/sb-admin.css" type="text/css" rel="stylesheet"> -->
<link
    href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
    rel="stylesheet" id="bootstrap-css">
<link rel="stylesheet"
    href="https://use.fontawesome.com/releases/v5.5.0/css/all.css"
    integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU"
    crossorigin="anonymous">
<link rel="stylesheet" href="../static/css/style.css"
    th:href="@{/css/style.css}">
</head>
<body>
    <div class="container">
        <div class="row">
            <div class="col">
                <div class="card">

                    <h5 class="card-header" style="background-color: powderblue;" th:text="#{mensaje.planificaciones}"></h5>
3
  • ¿Has probado usar la etiqueta meta de HTML? La colocas en tu sección <head>. Así: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> Es la espcificación oficial para HTML5. el 10 feb. 2019 a las 13:33
  • Si, pero sigue igual. el 10 feb. 2019 a las 13:48
  • La solución ha sido la comentada por @Alvaro Sánchez pero en vez de hacerlo sobre los archivos html lo he hecho solo los .properties. el 10 feb. 2019 a las 15:19

1 respuesta 1

1

Si estas trabajando con eclipse, coloque el ratón encima de su fichero html, haga click en el botón derecho de su ratón y pulse en properties y marque esta opción.

introducir la descripción de la imagen aquí

1

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.