geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Mulder <ammul...@alumni.princeton.edu>
Subject Re: Web Containers: Setting for directory listings?
Date Mon, 05 Dec 2005 23:10:05 GMT
So it sounds like if we add a setting to geronimo-web.xml and if the
user sets it, we could take control of this for both containers by
explicitly declaring the default servlet (if a default servlet is not
declared already) and then setting an init param on that servlet (so
long as that init param is not set already).  If the user does not set
the flag, we won't do anything and it will revert back to the server's
default bahavior (or a default servlet configured by the user, if
any).

Does that all sound right?

Thanks,
    Aaron

On 12/5/05, Jeff Genender <jgenender@apache.org> wrote:
> The DefaultServlet is the "catch-all" for the server where  can't
> process the URL.
>
> So to do this per web app, I guess you would just need to declare the
> DefaultServlet in the specific web.xml...and it should take over for
> that context.
>
> David Jencks wrote:
> > We can do the same thing server-wide for jetty using the StaticContent
> > servlet.  Is there a way to set it in tomcat per web-app?
> >
> > thanks
> > david jencks
> >
> > On Dec 5, 2005, at 2:33 PM, Jeff Genender wrote:
> >
> >> I'll explain Tomcat...
> >>
> >> In the var/catalina/conf/web.xml...change this for the DefaultServlet:
> >>
> >> <init-param>
> >>     <param-name>listings</param-name>
> >>     <param-value>false</param-value>
> >> </init-param>
> >>
> >> Jeff
> >>
> >>
> >>
> >> David Jencks wrote:
> >>> Again, ignoring tomcat :-)
> >>> I don't think just adding a default servlet like that to a
> >>> geronimo-web plan would work.  However, I think the way to go is to
> >>> add a flag to the jetty and jetty-config schemas and have the jetty
> >>> deployer set dirAllowed in the default servlet when it copies it in.
> >>> I'm not sure what else would be needed offhand.  It might run into
> >>> problems in identifying that particular servlet, as the copying
> >>> mechanism is somewhat generic.
> >>> thanks
> >>> david jencks
> >>> On Dec 5, 2005, at 1:46 PM, Jan Bartel wrote:
> >>>> Aaron,
> >>>>
> >>>> 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
> >>>> so:
> >>>>
> >>>>    <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">
> >>>> acceptRanges=true
> >>>> dirAllowed=true
> >>>> putAllowed=false
> >>>> delAllowed=false
> >>>> redirectWelcome=false
> >>>> minGzipLength=8192</attribute>
> >>>>        <attribute name="servletMappings">/</attribute>
> >>>>    </gbean>
> >>>>
> >>>> that the JettyWebModuleBuilder can use to set up the Default servlet
> >>>> for the webapp instead of using the StaticContent gbean from the
> >>>> j2ee-jetty-runtime-deployer-plan.xml.
> >>>>
> >>>> Comments?
> >>>>
> >>>> regards
> >>>> Jan
> >>>>
> >>>>
> >>>>
> >>>> 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
> >>>>>>
> >>>>
> >>
>

Mime
View raw message