geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Bartel <>
Subject Re: Web Containers: Setting for directory listings?
Date Mon, 05 Dec 2005 21:46:19 GMT

Leaving aside the possibility of genericizing this for both
tomcat & jetty and just considering the jetty implementation
for now:

It might be possible to be able to use the same kind of mechanism
in the geronimo-web.xml file as is used in the deployer plan.xml
file. That is, put a gbean into the geronimo-web.xml file like

    <gbean name="StaticContent" class="org.apache.geronimo.jetty.JettyServletHolder">
        <attribute name="servletName">defaultOverride</attribute>
        <attribute name="servletClass">org.mortbay.jetty.servlet.Default</attribute>
        <attribute name="loadOnStartup">0</attribute>
        <attribute name="initParams">
        <attribute name="servletMappings">/</attribute>

that the JettyWebModuleBuilder can use to set up the Default servlet
for the webapp instead of using the StaticContent gbean from the 



Jan Bartel wrote:
> Aaron,
> To disable/enable directory listing for Jetty, you
> must set the initParameter called dirAllowed to false/true for
> Jetty's default servlet called org.mortbay.jetty.servlet.Default.
> If I understand correctly, the jetty builder plan.xml sets this to true 
> for the container, but it should be possible to do this on a per-webapp 
> basis. Perhaps by putting a setter on the JettyWebAppContext class that 
> can be referenced from the geronimo-web.xml file?
> I will take a closer look at this and get back to you.
> regards
> Jan
> Aaron Mulder wrote:
>> It would be nice to have a settings in the geronimo-web.xml for
>> whether the web container should return a directory listing or a 404
>> error if the request URL points to a directory and there's no welcome
>> file present.
>> Do Jetty and Tomcat both support this?  Any idea whether it's easy to do?
>> Thanks,
>>     Aaron

View raw message