
UTF-8 Configuration in WebSphere, WebLogic, Tomcat, TC Server, JBoss


UTF-8 has become dominant character encoding for the web applications.
In this article, I will talk about how to configure UTF-8 in IBM WAS, Oracle Weblogic, Tomcat, TC Server & JBoss.
WebSphere Application Server
- Login into WebSphere Administrative Console
- Expand Servers >> Application Servers
- Click on Application Server (JVM) you want to enable UTF-8
- Expand Java and Process Management under Server Infrastructure
- Click on Process Definition
- Click on Java Virtual Machine
- Add the following parameter in Generic Java Arguments
-Dclient.encoding.override=UTF-8
- Click Ok, Sync the node if applicable
- Restart Application Server (JVM) for changes to take effect.
Oracle WebLogic Server
- Go to Weblogic Domain path
- Go to bin folder
- Add following parameter in setDomainEnv.sh under
JAVA_OPTS
variable.
-Dfile.encoding=utf8
- Restart Weblogic server for changes to take effect.
Tomcat
- Go to tomcat home (installation) folder
- Go to conf folder
- Add the following parameter in
server.xml
under Connector port.
URIEncoding="UTF-8"
Note: if you have multiple Connector ports, you must add them under all.
- Go to tomcat home (installation folder)
- Go to bin folder
- Add the following parameter in catalina.sh under
JAVA_OPTS
variable.
-Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8
Ex:
JAVA_OPTS=”-Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8”
- Restart Tomcat Server for changes to take effect.
TC Server
- Go to TC Server instance folder
- Go to conf folder
- Add the following parameter in server.xml under Connector port.
URIEncoding="UTF-8"
- Go to TC Server instance folder
- Go to bin folder
- Add following in setenv.sh under CATALINA_OPTS variable
-Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8
Ex:
CATALINA_OPTS="-Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8"
- Restart TC Server for changes to take effect.
JBoss Application Server
- Go to JBoss installation path
- Go to bin folder
- Add the following parameter in standalone.conf under JAVA_OPTS
-Dfile.encoding=UTF-8
- Restart JBoss Server for changes to take effect.
UTF-8 Validation Tools
You can use following online tool to validate if your web application is UTF-8 supported
http://coderstoolbox.net/string/
I hope above instructions help you in configuring UTF-8 in multiple application servers.
If you are looking to enhance skills in Oracle Weblogic administration, then check out this course by Chris Parent.
More great readings on Tomcat
-
How to Install Tomcat 9 and Where to Host it?Avi on February 20, 2021
-
How to Implement HTTP2 in Tomcat?Chandan Kumar on January 20, 2020
-
How to Fix Tomcat Stuck at Startup Issue?Chandan Kumar on January 20, 2020
-
How to Implement SSL in Apache Tomcat?Chandan Kumar on June 9, 2022
-
How to Enable Secure HTTP Header in Apache Tomcat 8?Chandan Kumar on January 31, 2022
-
How to Fix JBoss AS Stuck at Starting in Linux?Chandan Kumar on June 10, 2022
Join Geekflare Newsletter
Every week we share trending articles and tools in our newsletter. More than 10,000 people enjoy reading, and you will love it too.