如果发送中文,在后台管理查看时出现中文乱码现象(http://localhost:8161/admin)
此时需要配置过滤器进行转码:
在MQ的服务器目录中找到webapps/admin/WEB-INF中修改web.xml文件
添加如下过滤器
<filter>
<filter-name>characterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>characterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
网友评论