Wednesday, February 10, 2010

Jetty seems to ignore webdefault.xml

If just tried to edit webdefaults.xml to disable directory views, and the change was not reflected in my webapp. The reason: webdefaults.xml is not read by default, but must be explicitly added to the context of the webapp:


 <Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>

And suddenly all changes in webdefaults.xml are applied.

3 comments:

  1. Max,

    it's really good reading your micro blogs as you are learning jetty. It really interesting for the project to see how fresh eyes view the project. Please keep the entries coming and know that we are reading and will try to improve our act as a result.

    ReplyDelete
  2. If people use hot deployment, they should use the line from max in their deployment descriptor.

    Otherwise, it goes in jetty.xml in webapp deployer for static apps.

    Greg, it should be better documented in jetty, I spent 2 hours to figure this out.

    ReplyDelete
  3. I am still not able to get this work.

    I added above line to set defaultsDescriptor in web.xml but it did not help!

    Kindly help!

    ReplyDelete