Developers, Developers, Developers! Maksim Sorokin IT Blog

3Jul/10Off

Enable Directory Listings in GlassFish

There is a default-web.xml file in GlassFish which configure some stuff behind the scenes. This file can be found in domains->domain->config folder.

By default, in GlassFish v3 directory listing is disabled. But one can easily enable it by modifying default-web.xml file:

<init-param>
  <param-name>debug</param-name>
  <param-value>0</param-value>
</init-param>

Or if there is no possibility to modify the default-web.xml directly, add the following to your web.xml:

  <!-- Allow directory listing -->
  <servlet>
    <servlet-name>default</servlet-name>
    <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
    <init-param>
      <param-name>debug</param-name>
      <param-value>0</param-value>
    </init-param>
    <init-param>
      <param-name>listings</param-name>
      <param-value>true</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
Comments (0) Trackbacks (0)

Sorry, the comment form is closed at this time.

Trackbacks are disabled.