users@glassfish.java.net

Re: how do you turn off directory listings?

From: Scott Oaks <Scott.Oaks_at_Sun.COM>
Date: Tue, 06 Nov 2007 14:44:02 -0500

On Tue, 2007-11-06 at 14:44, glassfish_at_javadesktop.org wrote:
> JF,
>
> Do you mean to say if I have to turn on the directory-listing on all applications, I have undeploy
> and then redeploy setting this flag?

Yes he does (not to speak for JF, of course... :-)
>
> Is this because of some code generation magic during deployment?

Yes. This has bitten me before, in this and other contexts -- it turns
out that the default-web.xml is consulted only during deployment, and
not during runtime. When an app is deployed, it inherits whatever
settings are in default-web.xml *at that time*, and a web.xml is built
based on the web.xml from the war file and whatever settings aren't
overridden from default-web.xml. That web.xml is stored in the
generated/j2ee-{apps,modules}/... directory, and that web.xml is the
only thing that controls an apps behavior during runtime.

-Scott