0

I am trying to put some internationalization in my web page. But i faced with following exception: HTTP Status 500 - /patient/login.jsp (line: 8, column: 1) Page-encoding specified in XML prolog (UTF-16BE) is different from that specified in page directive (UTF-8)

Where is placed XML file that this error telling about? I have set UTF-8 encoding in my servlet, in page directive, also have an encoding filter. But still get this error....

It show ok when i delete the <%@page pageEncoding="UTF-8" %> but then , when i choose russian language it gives me trash(Knowing that russian needs UTF-8)

<%--
  Created by IntelliJ IDEA.
  User: User
  Date: 21.05.2016
  Time: 11:49
  To change this template use File | Settings | File Templates.
--%>
<%@page pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="language" value="${not empty param.language ? param.language : not empty language ? language : pageContext.request.locale}" scope="session" />
<fmt:setLocale value="${language}" scope="session"/>
<fmt:setBundle basename="by.epam.i18n.text" />
<html lang="${language}">
<head>
    <title></title>
</head>
<body>
<form>
  <select id="language" name="language" onchange="submit()">
    <option value="en" ${language == 'en' ? 'selected' : ''}>English</option>
    <option value="ru" ${language == 'ru' ? 'selected' : ''}>Русский</option>
    <option value="es" ${language == 'es' ? 'selected' : ''}>Español</option>
  </select>
</form>
  <form method="post" action="account">
    <table cellpadding="2" cellspacing="2">
      <tr>
        <td><label for="username"><fmt:message key="login.label.username" />: </label></td>
        <td><input type="text" name="username" id="username"></td>
      </tr>
      <tr>
        <td><label for="password"><fmt:message key="login.label.password"></fmt:message> </label>: </td>
        <td><input type="password" name="password" id="password"></td>
      </tr>
      <tr>
        <td></td>
        <fmt:message key="login.button.submit" var="buttonValue" />
        <td><input type="submit" value="${buttonValue}"></td>
      </tr>
    </table>
  </form>
  <footer class="container-fluid text-center">
    <p>Online Store Copyright</p>
    <form class="form-inline">Get deals:
      <input type="email" class="form-control" size="50" placeholder="Email Address">
      <button type="button" class="btn btn-danger">Sign Up</button>
    </form>
  </footer>
</body>
</html>
Alexander Tolkachev
  • 227
  • 1
  • 4
  • 15
  • Maybe this helps: http://stackoverflow.com/questions/138948/how-to-get-utf-8-working-in-java-webapps – mjn Jun 15 '16 at 12:09
  • Try to encode your jsp file as UTF-8 without BOM using Notepad++ or similar tool – Ilya Jun 15 '16 at 15:50

0 Answers0