1.jsp页面设置页头
<%@ page contentType="text/html; charset=gb2312" %>
2.ajax提交到后台时,用get/post都无所谓,也不需要编码
3.后台得到string时
s=new String(s.getBytes("ISO8859-1"),"GBK");
这样即可在后台得到正确的中文
4.从后台往页面传递内容如果有中文,则只需设置编码
response.setCharacterEncoding("GB2312");
1.jsp页面设置页头
<%@ page contentType="text/html; charset=gb2312" %>
2.ajax提交到后台时,用get/post都无所谓,也不需要编码
3.后台得到string时
s=new String(s.getBytes("ISO8859-1"),"GBK");
这样即可在后台得到正确的中文
4.从后台往页面传递内容如果有中文,则只需设置编码
response.setCharacterEncoding("GB2312");
pom文件增加以下依賴 <!-- mybatis-plus--> <dependency> <groupId>com.baomidou</groupId> <artif
在JDK的安裝目錄的lib目錄下有一個tools.jar文件,拷貝到Tomcat安裝目錄下的common\lib目錄下就行了.