org.apache.catalina.servlets
public class WebdavServlet extends DefaultServlet
<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
Version: $Revision: 769338 $ $Date: 2009-04-28 13:25:01 +0200 (Tue, 28 Apr 2009) $
Field Summary | |
---|---|
protected static SimpleDateFormat | creationDateFormat
Simple date format for the creation date ISO representation (partial). |
protected static String | DEFAULT_NAMESPACE
Default namespace. |
protected static MD5Encoder | md5Encoder
The MD5 helper object for this class. |
protected static MessageDigest | md5Helper
MD5 message digest provider. |
Method Summary | |
---|---|
protected boolean | checkIfHeaders(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes)
Check if the conditions specified in the optional If headers are
satisfied.
|
protected void | doCopy(HttpServletRequest req, HttpServletResponse resp)
COPY Method. |
protected void | doDelete(HttpServletRequest req, HttpServletResponse resp)
DELETE Method. |
protected void | doLock(HttpServletRequest req, HttpServletResponse resp)
LOCK Method. |
protected void | doMkcol(HttpServletRequest req, HttpServletResponse resp)
MKCOL Method. |
protected void | doMove(HttpServletRequest req, HttpServletResponse resp)
MOVE Method. |
protected void | doOptions(HttpServletRequest req, HttpServletResponse resp)
OPTIONS Method.
|
protected void | doPropfind(HttpServletRequest req, HttpServletResponse resp)
PROPFIND Method. |
protected void | doProppatch(HttpServletRequest req, HttpServletResponse resp)
PROPPATCH Method. |
protected void | doPut(HttpServletRequest req, HttpServletResponse resp)
Process a POST request for the specified resource.
|
protected void | doUnlock(HttpServletRequest req, HttpServletResponse resp)
UNLOCK Method. |
protected DocumentBuilder | getDocumentBuilder()
Return JAXP document builder instance. |
protected String | getRelativePath(HttpServletRequest request)
Override the DefaultServlet implementation and only use the PathInfo. |
void | init()
Initialize this servlet. |
protected void | service(HttpServletRequest req, HttpServletResponse resp)
Handles the special WebDAV methods. |
Parameters: request The servlet request we are processing response The servlet response we are creating resourceAttributes The resource information
Returns: boolean true if the resource meets all the specified conditions, and false if any of the conditions is not satisfied, in which case request processing is stopped
Parameters: req The request resp The response
Throws: ServletException If an error occurs IOException If an IO error occurs
Parameters: req The servlet request we are processing resp The servlet response we are creating
Throws: IOException if an input/output error occurs ServletException if a servlet-specified error occurs
Parameters: request The servlet request we are processing