Hi David,
I don't think just adding a default servlet like that to a geronimo-web
plan would work.
No? Why not? There should be no naming clashes etc.
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.
Sure, but then we'd have to declare a flag for each of the other
initParams when somebody asks to have them overrideable as well.
Seems neater to keep the same mechanism.
cheers
Jan
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