java乱码

解决乱码的方式:
          1.  new String("".getBytes("iso-8859-1","utf-8");
          2. <form> 表单的提交方式
          3. 在服务器中修改编码方式:
       <Service name="Tomcat_1">
    <Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="gbk"/>     
    <Engine name="Tomcat_1" defaultHost="localhost">
      <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
         <Context path="" docBase="F:\2013_ems\WebRoot" debug="0"  reloadable="true" />
          </Host>
    </Engine>
  </Service>

你可能感兴趣的:(java,tomcat)