Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » servlets » [javadoc | source]
org.apache.catalina.servlets
public class: WebdavServlet [javadoc | source]
java.lang.Object
   javax.servlet.GenericServlet
      javax.servlet.http.HttpServlet
         org.apache.catalina.servlets.DefaultServlet
            org.apache.catalina.servlets.WebdavServlet

All Implemented Interfaces:
    Serializable, Servlet, ServletConfig

Direct Known Subclasses:
    RuntimeWebdavServlet

Servlet which adds support for WebDAV level 2. All the basic HTTP requests are handled by the DefaultServlet. The WebDAVServlet must not be used as the default servlet (ie mapped to '/') as it will not work in this configuration. To enable WebDAV for a context add the following to web.xml:
<servlet>
<servlet-name>webdav</servlet-name>
<servlet-class>org.apache.catalina.servlets.WebdavServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>webdav</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>

This will enable read only access. To enable read-write access add:
<init-param>
<param-name>readonly</param-name>
<param-value>false</param-value>
</init-param>

To make the content editable via a different URL, using the following mapping:
<servlet-mapping>
<servlet-name>webdav</servlet-name>
<url-pattern>/webdavedit/*</url-pattern>
</servlet-mapping>

Don't forget to secure access appropriately to the editing URLs. With this configuration the context will be accessible to normal users as before. Those users with the necessary access will be able to edit content available via http://host:port/context/content using http://host:port/context/webdavedit/content

Field Summary
protected static final  String DEFAULT_NAMESPACE    Default namespace. 
protected static final  SimpleDateFormat creationDateFormat    Simple date format for the creation date ISO representation (partial). 
protected static  MessageDigest md5Helper    MD5 message digest provider. 
protected static final  MD5Encoder md5Encoder    The MD5 helper object for this class. 
Fields inherited from org.apache.catalina.servlets.DefaultServlet:
debug,  input,  listings,  readOnly,  output,  urlEncoder,  localXsltFile,  globalXsltFile,  readmeFile,  resources,  fileEncoding,  sendfileSize,  FULL,  mimeSeparation,  RESOURCES_JNDI_NAME,  sm,  BUFFER_SIZE
Method from org.apache.catalina.servlets.WebdavServlet Summary:
checkIfHeaders,   doCopy,   doDelete,   doLock,   doMkcol,   doMove,   doOptions,   doPropfind,   doProppatch,   doPut,   doUnlock,   getDocumentBuilder,   getRelativePath,   init,   normalize,   service
Methods from org.apache.catalina.servlets.DefaultServlet:
checkIfHeaders,   checkIfMatch,   checkIfModifiedSince,   checkIfNoneMatch,   checkIfUnmodifiedSince,   checkSendfile,   copy,   copy,   copy,   copy,   copy,   copy,   copyRange,   copyRange,   copyRange,   copyRange,   destroy,   displaySize,   doDelete,   doGet,   doHead,   doPost,   doPut,   executePartialPut,   findXsltInputStream,   getETag,   getReadme,   getRelativePath,   init,   parseContentRange,   parseRange,   render,   renderHtml,   renderSize,   renderXml,   rewriteUrl,   serveResource
Methods from javax.servlet.http.HttpServlet:
service
Methods from javax.servlet.GenericServlet:
destroy,   getInitParameter,   getInitParameterNames,   getServletConfig,   getServletContext,   getServletInfo,   getServletName,   init,   init,   log,   log,   service
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.servlets.WebdavServlet Detail:
 protected boolean checkIfHeaders(HttpServletRequest request,
    HttpServletResponse response,
    ResourceAttributes resourceAttributes) throws IOException 
    Check if the conditions specified in the optional If headers are satisfied.
 protected  void doCopy(HttpServletRequest req,
    HttpServletResponse resp) throws IOException, ServletException 
    COPY Method.
 protected  void doDelete(HttpServletRequest req,
    HttpServletResponse resp) throws IOException, ServletException 
    DELETE Method.
 protected  void doLock(HttpServletRequest req,
    HttpServletResponse resp) throws IOException, ServletException 
    LOCK Method.
 protected  void doMkcol(HttpServletRequest req,
    HttpServletResponse resp) throws IOException, ServletException 
    MKCOL Method.
 protected  void doMove(HttpServletRequest req,
    HttpServletResponse resp) throws IOException, ServletException 
    MOVE Method.
 protected  void doOptions(HttpServletRequest req,
    HttpServletResponse resp) throws IOException, ServletException 
    OPTIONS Method.
 protected  void doPropfind(HttpServletRequest req,
    HttpServletResponse resp) throws IOException, ServletException 
    PROPFIND Method.
 protected  void doProppatch(HttpServletRequest req,
    HttpServletResponse resp) throws IOException, ServletException 
    PROPPATCH Method.
 protected  void doPut(HttpServletRequest req,
    HttpServletResponse resp) throws IOException, ServletException 
    Process a POST request for the specified resource.
 protected  void doUnlock(HttpServletRequest req,
    HttpServletResponse resp) throws IOException, ServletException 
    UNLOCK Method.
 protected DocumentBuilder getDocumentBuilder() throws ServletException 
    Return JAXP document builder instance.
 protected String getRelativePath(HttpServletRequest request) 
    Override the DefaultServlet implementation and only use the PathInfo. If the ServletPath is non-null, it will be because the WebDAV servlet has been mapped to a url other than /* to configure editing at different url than normal viewing.
 public  void init() throws ServletException 
    Initialize this servlet.
 protected String normalize(String path) 
    Return a context-relative path, beginning with a "/", that represents the canonical version of the specified path after ".." and "." elements are resolved out. If the specified path attempts to go outside the boundaries of the current context (i.e. too many ".." path elements are present), return null instead.
 protected  void service(HttpServletRequest req,
    HttpServletResponse resp) throws IOException, ServletException 
    Handles the special WebDAV methods.