SiteMesh官网文档:http://wiki.sitemesh.org/wiki/display/sitemesh3/Home

配置过滤器

public class EncodingFilter implements Filter{

    public void init(FilterConfig filterConfig) throws ServletException {
        System.setProperty("file.encoding","utf-8");

    }

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
            throws IOException, ServletException {
        request.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=UTF-8");
        chain.doFilter(request, response);
    }

    public void destroy() {

    }

}