Linux 修改 Tomcat 编码
生活随笔
收集整理的這篇文章主要介紹了
Linux 修改 Tomcat 编码
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
默認情況下,Tomcat對請求采用的默認編碼是ISO-8859-1
一、修改 Tomcat 配置文件
conf/server.xml
useBodyEncodingForURI="true" URIEncoding="UTF-8" <Connector port="8080" protocol="HTTP/1.1"connectionTimeout="20000"redirectPort="8443" useBodyEncodingForURI="true" URIEncoding="UTF-8"/>String提供的編碼轉化
String str = new String(str .getBytes(“ISO8859-1”),“UTF-8”).trim();
總結
以上是生活随笔為你收集整理的Linux 修改 Tomcat 编码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 前端学习(3002):vue+eleme
- 下一篇: [html] websocket和ht