To define and map the WebDAV servlet to a specific context and URL, add the following to $CATALINA_HOME/webapps//WEB_INF/web.xml: Step 1 - Define and map the WebDAV servlet If you don't have any applications to test WebDAV with, use Maven or a similar tool to generate and deploy a simple skeleton application to experiment with.
In this example, we'll demonstrate how to enable WebDAV access for a generic web application called "myApp". The WebDAV servlet can be used with any application OTHER THAN the root context. However, you can also follow along below if you would like to take a more hands-on approach.)Īs the servlet classes are already included with Tomcat, all that you need to do to enable the WebDAV Servlet is define it in the deployment descriptor of the Context which you want to enable for WebDAV access. If you are using an earlier version of Tomcat, you should be able to test WebDAV by simply deploying this example application. (Note: This tutorial assumes you are running Tomcat 6.x or higher, which are not packaged with the "webdav" example application. Follow these simple steps to configure, secure and t est connectivity to a Tomcat-hosted WebDAV folder. Let's get to know Tomcat's WebDAV implementation. Tomcat implements the WebDAV specification using a servlet called WebDAV Servlet, which is included with all standard Tomcat distributions. In fact, one of the explicit features built-in to WebDAV is that complex features such as versioning and merge are handled either by WebDAV based extensions or by the client itself, making WebDAV itself quite versatile and lightweight. While the basic servlet provides none of these capabilities in a manner suitable for use with a complex application, the Tomcat implementation can be a useful starting point, rather than building an implementation from scratch.Īs WebDAV is an extension of the HTTP protocol, rather than a protocol in its own right, its methods are always interpreted by a helper framework of some kind. There are a number of reasons why you might want to host a WebDAV mount within your application or on your application server, such as providing upload/download capabilities to your users, or providing you a secure remote way of viewing internal log files. We'll wrap up with a high-level look at some of the ways you can use WebDAV within your Tomcat applications. In this article, we'll provide an introduction to using WebDAV with applications hosted on Apache Tomcat, so you can begin considering how the WebDAV protocol can best benefit your architecture.įirst, we'll walk you through the basic steps required to enable a hosted WebDAV folder on your Apache Tomcat server, including configuration, basic security and connectivity testing. Extensions such as Delta-V, DASL, GroupDAV and CalDAV offer additional features under the same protocol, including revision tracking, search, group data stores and calendaring.
The functionality that WebDAV provides is similar to FTP, but is more efficient and supports complex functions such as authentication, encryption without SSH, proxy support and caching, as well as more specialized verb methods such as LOCK and UNLOCK, all over HTTP.
Web-based Distributed Authoring and Versioning, or WebDAV, is a set of HTTP protocol extensions that allow collaborative editing and management of files stored on a remote server or servers.
Configure Tomcat WebDAV access in 3 easy steps