标签:toc tom app 9.png 解决 redirect ping java protocol
Java操作数据库可能会存在乱码,一般来说配置一下web.xml就行,不过有些需要配置一下Tomact
<!-- 中文乱码配置 -->
<filter>
<filter-name>SetCharacterEncoding</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>
</filter>
<filter-mapping>
<filter-name>SetCharacterEncoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
然后是配置Tomcat下的server.xml
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8"/>
标签:toc tom app 9.png 解决 redirect ping java protocol
原文地址:https://www.cnblogs.com/qinxiaowan/p/9660505.html