How can I "say" Spring Boot to use the UTF-8 encoding, to show and save German umlauts correctly? We are programming a Java-Webapplication using Sping-Boot 1.1.1 (Release) and as webserver a TomCat7 or Jetty. The database is postgresql or h2 for testing.
Edit:
I tried it with the properties file (thanks for the answer), but no changes are visible.
The database is also UTF-8... Especially the problem comes, when we send a POST-Request to the Webserver. The Spring-Request-Handler gets already the broken encoded values. In the following you can see a part of the code: (It shows a snippet of the Thymeleaf-Template)
<form accept-charset="utf-8" method="post">
<div class="row">
<fieldset th:object="${model}">
<!-- CSRF token -->
<th:block th:replace="makros :: csrf" />
<div class="col-sm-4 form-group" >
<label for="firstname" th:text="#{edit_user.first_name}">Given Name</label>
<input class="form-control required" type="text" required="required" id="firstname" name="firstname" th:field="*{firstName}" />
</div>
<div class="col-sm-4 form-group">
<label for="firstname" th:text="#{edit_user.last_name}">Family Name</label>
<input class="form-control required" type="text" required="required" id="lastname" name="lastname" th:field="*{lastName}" />
</div>
</fieldset>
</div>
</form>
And this is the request handler for that:
@RequestMapping(method = RequestMethod.POST)
public String handleUserUpdate(@ModelAttribute(MODEL) UpdateUserCommand command) {
//here we cut the broken encoded values
}
Greetings Stef