Configuring JBOSS to support UTF-8 characters in the URL

The problem I have experienced this week. When I have chinese characters as part of the URL, the characters show up as garbage in the page. I mean request.getParameter(”chineseCharacter”) returns garbage characters. This problem happened in JBOSS 4.2.3 GA with Apache 2.0(mod_jk).

Fortunately the solution is simple:

Edit JBOSS_HOME/server/${SERVER_NAME}/deploy/jboss-web.deployer/server.xml

Add URIEnconding=”UTF-8″ to the HTTP connector and AJP connector:

<Connector port="8080" address="${jboss.bind.address}"
         maxThreads="250" maxHttpHeaderSize="8192"
         emptySessionPath="true" protocol="HTTP/1.1"
         enableLookups="false" redirectPort="8443" acceptCount="100"
         connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"/>

   <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" address="${jboss.bind.address}" protocol="AJP/1.3"
         emptySessionPath="true" enableLookups="false" redirectPort="8443" URIEncoding="UTF-8"/>



Now restart your server and you should have no more problems with having non-latin characters in the URL.

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Twitter

Leave a Reply