Sun GlassFish Enterprise Server v3 Prelude Developer's Guide

Enabling WebDav

To enable WebDav in the Enterprise Server, you edit the web.xml and sun-web.xml files as follows.

First, enable the WebDav servlet in your web.xml file:


Then define the servlet mapping associated with your WebDav servlet in your web.xml file:


To protect the WebDav servlet so other users can't modify it, add a security constraint in your web.xml file:

      <web-resource-name>Login Resources</web-resource-name>

Then define a security role mapping in your sun-web.xml file:


If you are using the file realm, create a user and password. For example:

asadmin create-file-user --user admin --host localhost --port 4848 --terse=true 
--groups Admin --authrealmname default admin

Enable the security manager as described in Enabling and Disabling the Security Manager.

You can now use any WebDav client by connecting to the WebDav servlet URL, which has this format:


For example:


You can add the WebDav servlet to your default-web.xml file to enable it for all applications, but you can't set up a security role mapping to protect it.