I have a project use spring MVC, with Tiles3 use Freemarker as view engine, I have a page addItem.ftl
<div id="content">
<fieldset>
<legend>Add Item</legend>
<form name="item" action="add" method="post">
<label>
name商品名称
<input type="text" name="name"/>
</label><br/>
<label>
serialNumber
<input type="text" name="serialCode"/>
</label><br/>
<label>
weight重量
<input type="text" name="weight"/>
</label><br/>
<input type="submit" value="Save"/>
</form>
</fieldset>
<br/>
<table class="datatable">
<tr>
<th>Make</th>
<th>Model</th>
</tr>
<#list model["carList"] as Item>
<tr>
<td>${Item.id}</td>
<td>${Item.name}</td>
</tr>
</#list>
I have a form for user input and a table to pull data from database and display them dynamicly.
But the page display like this
as you can see, the Chinese I put in the ftl file are not displayed properly, but the Chinese I get from database and add to the page works fine. I'm sure my file encoding is utf-8. I suspect that it's the freeMarkerRenderer not configured properly, but I tryed all I can, just doesn't work, you can check out the whole project here github