Problem Encoding Grails Request Parameters in Tomcat

My grails app will not decode request parameters correctly.

In config.groovy:

  • grails.views.gsp.encoding = "UTF-8"
  • grails.converters.encoding = "UTF-8"

All my gsp are used contentType="text/html; charset=UTF-8"in the page directive as well as <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />in the head element.

However, when I get the published parameters from the param object in my controller, the application just prints the garbage ...

I am using Grails version 1.3.7 deployed on top of Tomcat 5. Other installed plugins besides tomcat:

hibernate 1.3.7 jquery 1.7.1 spring-security-core 1.2.6 webxml 1.4

EDIT: from further debugging, I noticed that the application will work fine in the dock. Therefore, I suspect that this is a problem with the cat. My problem is similar to this post (alas, I do not use the Shiro plugin).

Can anyone help with this?

+5
3

URIEncoding='UTF-8' Connector conf/server.xml, .

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

: https://wiki.apache.org/tomcat/FAQ/CharacterEncoding

+8
edit application.properties
add(update) line:
plugins.webxml=1.4.1
0

, . .

, , MySQL. env - Centos 6, MySQL, Tomcat 6 Apache.

In the Dev environment, everything was o'k, but not in production. The only thing that helped me was installed in autoreconnect=true&useUnicode=true&characterEncoding=UTF-8addition to the recommendations for both TomcatURIEncoding='UTF-8'

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

0
source

All Articles