因为刚接触
DWZ,使用起来还完全还很生疏,无意中发现后台有乱码
乱码: ä¸åˆå‘¢
搜索了一下 发现网上还有是有类似的问题
不过却没有最终的解答
索性就加了个编码过滤器来完成功能.
web.xml
<!--编码过滤器-->
<filter>
<filter-name>EncodingFilter</filter-name>
<filter-class>
com.ymkj.dcode.util.SetCharacterEncodingFilter
</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>ignore</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>EncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
SetCharacterEncodingFilter.java
package com.ymkj.dcode.util;
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License a