Question

I cannot access a directory that contains special characters in JBoss. I have configured JBoss so the directory listing is enabled.

For example, let's say I have a war (myApp.war) deployed in JBoss that contains a directory named "Categoría 1".

In order to access the war contents from a browser, I browse correctly to:

"http://localhost:8080/myApp/"

When I browse this URL, I get the contents displayed correctly, including "Categoría 1" directory name. The URL that the browser displays as the link to get this directory is:

"http://localhost:8080/myApp/Categor%C3%ADa%201/"

But When I try to browse this directory, I get a 404 error:

"JBWEB000065: HTTP Status 404 - /myApp/Categor%C3%ADa%201/

JBWEB000309: type JBWEB000067: Status report

JBWEB000068: message /myApp/Categor%C3%ADa%201/

JBWEB000069: description JBWEB000124: The requested resource is not available.

JBoss Web/7.2.2.Final-redhat-1"

My final intention is to get the directory contents from a servlet and parse the response to display these contents in a different way, not just the html returned as the result of browsing the directory. But since I was having the same problem with character encoding, I just tested something simpler, with a Chrome or iExplorer browser, but the problem seems to be the same.

Was it helpful?

Solution

I have found how to solve this. It is related to the JBoss configuration. The encoding must be set to UTF-8 (in my case). The configuration file for standalone server is located in:

JBoss_base_directory/standalone/configuration/standalone.xml

and the properties to set:

 <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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top