`

中文乱码问题

 
阅读更多

一、Tomcat server.xml配置

 

<Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
			   URIEncoding="utf-8"
               redirectPort="8443" />

二、jsp

<%@ page language="java" import="java.util.*" pageEncoding="utf-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
%>

   

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics