Tuesday 24 March 2015

Enable Directory Listings in GlassFish

You can use the default-web.xml file to define features such as filters and security constraints that apply to all web applications.
For example, directory listings are disabled by default for added security. To enable directory listings, in your domain's default-web.xml file, search for the definition of the servlet whose servlet-name is equal to default, and set the value of the init-param namedlistings to true. Then redeploy your web application if it has already been deployed, or restart the server.

   listings
   true
If listings is set to true, you can also determine how directory listings are sorted. Set the value of the init-param named sortedByto NAMESIZE, or LAST_MODIFIED. Then redeploy your web application if it has already been deployed, or restart the server.

   sortedBy
   LAST_MODIFIED
The mime-mapping elements in default-web.xml are global and inherited by all web applications. You can override these mappings or define your own using mime-mapping elements in your web application's web.xml file. For more information about mime-mappingelements, see the Servlet specification.

You can use the Administration Console to edit the default-web.xml file. For details, click the Help button in the Administration Console. As an alternative, you can edit the file directly using the following steps.

http://docs.oracle.com/cd/E19798-01/821-1752/beaft/index.html