您的位置:首页 > 运维架构 > Tomcat

J2EE编辑中的中文乱码解决问题

2015-06-27 19:38 531 查看
服务器:Tomcat 6.0

常用解决方法有以下3种:

1、在所有的.jsp文件的首行加上<%@ page contentType="text/html;charset=GBK"%>或者<%@ page language="java" pageEncoding="GBK"%>

2、在 <head>  </head>中的首行加上  <meta http-equiv="Content-Type" content="text/html; charset=GBK">,如下:

<head>

  <meta http-equiv="Content-Type" content="text/html; charset=GBK">

    <title></title>

  </head>

3、配置Tomcat 6.0\conf\server.xml

<Connector port="8080" 
maxThreads="150" minSpareThreads="25" maxSpareThreads="75" 
enableLookups="false" redirectPort="8443" acceptCount="100" 
debug="0" connectionTimeout="20000" useBodyEncodingForURI="true" 
disableUploadTimeout="true" /> 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  J2EE 乱码 tomcat