`

tomcat设置文件(解决中文参数乱码问题)

阅读更多

<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="8005" shutdown="SHUTDOWN">

  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container", 
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">
  
    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" 
        maxThreads="150" minSpareThreads="4"/>
    -->
    
    
    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1" 
    		   URIEncoding="UTF-8"
               connectionTimeout="20000" 
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    -->           
    <!-- Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the JSSE configuration, when using APR, the 
         connector should be using the OpenSSL style configuration
         described in the APR documentation -->
    <!--
    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">         
    --> 
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->        

      <!-- The request dumper valve dumps useful debugging information about
           the request and response data received and sent by Tomcat.
           Documentation at: /docs/config/valve.html -->
      <!--
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
      -->

      <!-- This Realm uses the UserDatabase configured in the global JNDI
           resources under the key "UserDatabase".  Any edits
           that are performed against this UserDatabase are immediately
           available for use by the Realm.  -->
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

      <!-- Define the default virtual host
           Note: XML Schema validation will not work with Xerces 2.2.
       -->
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  
               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
        -->

      </Host>
    </Engine>
  </Service>
</Server>
 
分享到:
评论

相关推荐

    tomcat值乱码解决

    一般我们所装的linux服务器,是中文版的,所以系统环境的编码是gbk,然而我们项目的编码是UTF-8,这就必须在tomcat的server.xml文件中修改,在两个地方添加 URIEncoding="UTF-8",具体代码如下:

    SmartUpload 用于JDK1.5(中文终极解决版,包括中文文件名上传后乱码,中文参数,下载)

    经过呕心沥血的一天一夜,终于搞定SmartUpload组件的所有中文问题,为大家去除有史以来最头痛的中文问题,包括中文参数,中文文件名上传后服务器端文件名乱码问题,以及中文文件名下载问题。 这是我的中文解决终极...

    SmartUpload 上传组件(中文终极解决版,包括中文文件名上传后乱码,中文参数,下载),JDK 1.6

    经过呕心沥血的一天一夜,终于搞定SmartUpload组件的所有中文问题,为大家去除有史以来最头痛的中文问题,包括中文参数,中文文件名上传后服务器端文件名乱码问题,以及中文文件名下载问题。 这是我的中文解决终极...

    SmartUpload 用于JDK1.4(中文终极解决版,包括中文文件名上传后乱码,中文参数,下载)

    经过呕心沥血的一天一夜,终于搞定SmartUpload组件的所有中文问题,为大家去除有史以来最头痛的中文问题,包括中文参数,中文文件名上传后服务器端文件名乱码问题,以及中文文件名下载问题。 这是我的中文解决终极...

    IDEA中Tomcat乱码问题

    问题描述 Tomcat启动时控制台日志乱码  解决方法 第一种方式 首先修改IDEA中的编码方式 修改tomcat目录下conf 配置目录下的 logging.properties文件 java.util.logging.ConsoleHandler.encoding = GBK  结果: ...

    Tomcat-7.0.30

    修改目的:为了解决使用HTTP Get方法传递中文参数乱码的问题 修改context.xml: 把修改成&lt;Context reloadable="true"&gt; 修改目的:当Web应用中的文件或者web.xml文件修改后,Tomcat服务器 会自动重新加载当前Web...

    Get中文乱码IE浏览器Get中文乱码解决方案

    Get中文乱码问题解决方案: 修改Tomcat根目录下conf / server.xml文件,代码如下: 代码如下: ”8080″ protocol=”HTTP/1.1″ connectionTimeout=”20000″ redirectPort=”8443″ URIEncoding=”UTF-8″&gt; 但是,...

    SmartUpload 上传组件(中文终极解决版) JDK1.6

    经过呕心沥血的一天一夜,终于搞定SmartUpload组件的所有中文问题,为大家去除有史以来最头痛的中文问题,包括中文参数,中文文件名上传后服务器端文件名乱码问题,以及中文文件名下载问题。 这是我的中文解决终极...

    jsp之间传参数接受中文有乱码问题解决方法

    tomcat 的配置文件 server.xml里面找到: 代码如下: ”8080″ protocol=”HTTP/1.1″ maxThreads=”... 您可能感兴趣的文章:JSP上传图片产生 java.io.IOException: Stream closed异常解决方法分享JSP中文乱码解决方法JSP

    支持中文的jspsmartupload

    经过呕心沥血的一天一夜,终于搞定SmartUpload组件的所有中文问题,为大家去除有史以来最头痛的中文问题,包括中文参数,中文文件名上传后服务器端文件名乱码问题,以及中文文件名下载问题。 这是我的中文解决终极...

    JQuery 传送中文乱码问题的简单解决办法

    一、客户端先进行编码,服务端再解码。 客户端发送数据: var names = encodeURIComponent("电费"); names = encodeURIComponent( names); $.post("test.do?names="+name,null, function(){}...利用方式一虽然可以解决

    fckeditor(jsp版)

    采用2.6.4版本,彻底解决fckeditor(jsp版)上传中文文件乱码问题。 使用Tomcat应用服务器时,为了更好的支持URL地址中的中文参数问题.需要在tomcat进行如下设置: 需要修改server.xml文件的如下行: maxThreads=...

    Tomcat和JavaVirtualMachine的性能调优总结

    当然还有其他一些性能调优的设置,下图是我根据我机子的性能设置的一些参数值,给各位详细解释一下吧:1、URIEncoding="UTF-8":设置Tomcat的字符集。这种配置我们一般是不会设置的,因为关于乱码的转换我们会在具体...

    免费开源的 Java Web 应用服务器 -- Apache Tomcat

    Apache Tomcat 版本号: 8.5 ,10.0(新增) 配置方法及常见问题处理: ...4、GET方式URL乱码问题解决 5、虚拟主机配置文件 6、新增版本中javax.servlet替换为jakarta.servlet的问题及解决办法 详见发布者博客

    Tomcat源码研究

    4 GET方式URL乱码问题解决  打开 tomcat/conf/server.xml 查找下面这部分,在最后增加一段代码就可以了。 ...

    jforum-2.5.0修正版

    为了解决中文问题修改了WebRequestContext.java类。 第149行,default.container.encoding应赋于ISO-8859-1,此处把这个值改为了encoding的值即utf-8,导致下面从httprequest中取到值转化时乱码。 代码如下: if (is...

    吴天雄--JavaWeb完整笔记.doc

    本文档总计92页,20928个字,共分为九大模块,模块一:javaWeb入门概念(资源分类、网络通信三要素、软件架构...模块九:文件上传和下载(限制上传(文件的大小和类型)、详细代码、解决下载时文件名乱码问题) --author

    大学生毕设+基于JavaWeb带GUI界面+花店管理系统(前后端源码+数据库)

    网上花店(flower) 功能简介: 1, 支持商品展示, 分类搜索查看详情等 ...3, 请保证数据库默认编码为utf8, 否则可能会出现中文乱码问题 4, 项目简陋, 仅供学习参考, 如有任何问题请旺旺联系 测试用户: 前台1/1 后台1

    fckedit编辑器

    这样解决了文件上传的中文乱码问题. 但是在控制台显示的中文内容还是乱码,但是没关系,我们没必要去看控制台下的中文 ----------------------------------------------------------------another FCKeditor2.4.2 ...

Global site tag (gtag.js) - Google Analytics