1:前端页面是jsp页面,只需要在jsp页面的首行加入: <%@ page contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true" language="java" %> 2:前端页面是html页面,只需要在HTML页面的首行加入: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />