我遇到了內頁問題。它只是將頁面識別爲iso,但我想要utf-8,我將它聲明爲默認字符集。我在freemarker配置上嘗試了一些修改,但它們沒有效果。t上的Freemarker utf-8編碼問題。
彈簧servlet.xml中
<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
<property name="templateLoaderPath" value="/WEB-INF/pages/"/>
</bean>
template.html
<#macro page>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cemitério - Prefeitura Municipal de Maringá</title>
</head>
<body>
Usuários
<#nested/>
</body>
</html>
</#macro>
的login.html
<#import "templates/template.html" as t/>
<@t.page>
<#if erroLogin??>
${erroLogin}
</#if>
<form action="entrar" method="post">
<div>
<label>Usuário:</label>
<input type="text" name="usuario" />
<br />
<label>Senha:</label>
<input type="text" name="senha" />
<br />
<input type="submit" name="submit" />
</div>
</form>
</@t.page>
輸出
很棒的工作!現在沒事了。 – claudioivp 2013-02-20 14:05:12