jbossckeditorjboss7.xckeditor5response-headers

JBOSS appends charset=ISO-8859-1 in response headers


JBOSS v7.4 appends charset=ISO-8859-1 to my js files due to which browser throws "Unexpected token" error for files with special characters.

The same file loads correctly on Weblogic and Tomcat servers since there's no charset added.

Currently it is throwing error for html support plugin(html-support.js) of CKEditor v5.

Have checked on various forums and below suggested solutions didn't worked.

  1. Adding encoding in standalone.conf and domain.conf
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8"
JAVA_OPTS="$JAVA_OPTS -Dorg.apache.catalina.connector.URI_ENCODING=UTF-8"
  1. Adding system properties in standAlone.xml and domain.xml
<system-properties>
  <property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>
  <property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true"/>
</system-properties>
  1. Addin Encoding param in jboss-web.xml and web.xml
<context-param>
  <param-name>PARAMETER_ENCODING</param-name>
  <param-value>UTF-8</param-value>
</context-param>

Solution

  • Finally after a lot of trail and error, was able to resolve this issue by referring suggestions from JBoss issue forum - https://issues.redhat.com/browse/WFLY-2533

    <default-encoding>UTF-8</default-encoding>
    

    The above param should be added in jboss-web.xml. This file is located here :

    {JBOSS_HOME}/standalone/deployments/{server_name}/{server_name.ear}/{your_app.war}/WEB-INF/jboss-web.xml