當(dāng)前位置:首頁(yè) > IT技術(shù) > 編程語(yǔ)言 > 正文

Spring 解決亂碼問(wèn)題
2022-04-25 23:03:39

Spring 解決亂碼問(wèn)題

把下面代碼放置到web.xml下即可解決

    <filter>
<filter-name>encoding</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>encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

本文摘自 :https://blog.51cto.com/M

開(kāi)通會(huì)員,享受整站包年服務(wù)立即開(kāi)通 >