Grails request parameters encoding issue in Tomcat

前端 未结 3 1526
离开以前
离开以前 2020-12-18 06:19

My grails app will not decode request parameters correctly.

In config.groovy:

  • grails.views.gsp.encoding = \"UTF-8\"
  • grails
相关标签:
3条回答
  • 2020-12-18 06:26

    As fas as no final conclusion made, I'd like to share my expierence in the same situation. Here one can find more discussion.

    I my case, I have dev environment under the windows on local pc including local MySQL. Production env - Centos 6, MySQL, Tomcat 6 behind Apache.

    In dev environment - everything was o'k, but on production - no. The only thing that help me - was set autoreconnect=true&useUnicode=true&characterEncoding=UTF-8 additionally to recommendations both for Tomcat URIEncoding='UTF-8'

    So, the problem was in correct settings java Driver for MySQL.

    0 讨论(0)
  • 2020-12-18 06:28

    You need to add URIEncoding='UTF-8' to the Connector elements in conf/server.xml, e.g.

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

    This is described here: https://wiki.apache.org/tomcat/FAQ/CharacterEncoding

    0 讨论(0)
  • edit application.properties
    add(update) line:
    plugins.webxml=1.4.1
    
    0 讨论(0)
提交回复
热议问题