Не получается корректно отобразить кодировку в расширении mustache
Не могу настроить отображение на кириллице файлов с расширением mustache через Spring boot
Вот файл мустач на который переводит контроллер по запросу /addexcel :
<html lang="en">
<head>
<meta charset="utf-8">
<title>Отправка файла на сервер</title>
</head>
<body>
<div>
<form action="\logout" method="post">
<input type="submit" value="Выйти"/>
</form>
</div>
<div></div>
<div></div>
<h3>Добавьте файл для расчета статистики:</h3>
<div></div>
<div></div>
<form enctype="multipart/form-data" method="post" action="/getResult">
<p><input type="file" name="file">
<input type="submit" value="Отправить"></p>
</form>
<div></div>
<div></div>
</body>
</html>
Вот app properties:
spring.application.name=XLSX4
spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.file-size-threshold=2KB
spring.servlet.multipart.max-request-size=10MB
Вот pom.xml:
modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.workproject</groupId>
<artifactId>XLSX5</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>XLSX5</name>
<description>XLSX parcer project for Spring Boot</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<properties>
<java.version>17</java.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mustache</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity6</artifactId>
<!-- Temporary explicit version to fix Thymeleaf bug -->
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Вот так отображается:
Ответы (2 шт):
Автор решения: Vaagn Akopyan
→ Ссылка
Отображение налаживается лишь только когда меняешь язык самого браузера с русского на английский. Но это я не считаю за решение.