|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet org.apache.catalina.servlets.DefaultServlet org.apache.catalina.servlets.WebdavServlet
public class WebdavServlet
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.
Mapping a subpath (e.g./webdav/*
to this servlet has the effect
of re-mounting the entire web application under that sub-path, with WebDAV
access to all the resources. This WEB-INF
and META-INF
directories are protected in this re-mounted resource tree.
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>false</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, use the following mapping:
<servlet-mapping> <servlet-name>webdav</servlet-name> <url-pattern>/webdavedit/*</url-pattern> </servlet-mapping>By default access to /WEB-INF and META-INF are not available via WebDAV. To enable access to these URLs, use add:
<init-param> <param-name>allowSpecialPaths</param-name> <param-value>true</param-value> </init-param>Don't forget to secure access appropriately to the editing URLs, especially if allowSpecialPaths is used. With the mapping configuration above, 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
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.catalina.servlets.DefaultServlet |
---|
DefaultServlet.Range |
Field Summary | |
---|---|
protected static java.text.SimpleDateFormat |
creationDateFormat
Simple date format for the creation date ISO representation (partial). |
protected static java.lang.String |
DEFAULT_NAMESPACE
Default namespace. |
protected static MD5Encoder |
md5Encoder
The MD5 helper object for this class. |
protected static java.security.MessageDigest |
md5Helper
MD5 message digest provider. |
Fields inherited from class org.apache.catalina.servlets.DefaultServlet |
---|
BUFFER_SIZE, contextXsltFile, debug, fileEncoding, FULL, globalXsltFile, input, listings, localXsltFile, mimeSeparation, output, readmeFile, readOnly, resources, RESOURCES_JNDI_NAME, sendfileSize, sm, urlEncoder, useAcceptRanges |
Constructor Summary | |
---|---|
WebdavServlet()
|
Method Summary | |
---|---|
protected boolean |
checkIfHeaders(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ResourceAttributes resourceAttributes)
Check if the conditions specified in the optional If headers are satisfied. |
protected void |
doCopy(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
COPY Method. |
protected void |
doDelete(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
DELETE Method. |
protected void |
doLock(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
LOCK Method. |
protected void |
doMkcol(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
MKCOL Method. |
protected void |
doMove(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
MOVE Method. |
protected void |
doOptions(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
OPTIONS Method. |
protected void |
doPropfind(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
PROPFIND Method. |
protected void |
doProppatch(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
PROPPATCH Method. |
protected void |
doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Process a POST request for the specified resource. |
protected void |
doUnlock(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
UNLOCK Method. |
protected javax.xml.parsers.DocumentBuilder |
getDocumentBuilder()
Return JAXP document builder instance. |
protected java.lang.String |
getPathPrefix(javax.servlet.http.HttpServletRequest request)
Determines the prefix for standard directory GET listings. |
protected java.lang.String |
getRelativePath(javax.servlet.http.HttpServletRequest request)
Override the DefaultServlet implementation and only use the PathInfo. |
protected java.lang.String |
getRelativePath(javax.servlet.http.HttpServletRequest request,
boolean allowEmptyPath)
|
void |
init()
Initialize this servlet. |
protected void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Handles the special WebDAV methods. |
Methods inherited from class org.apache.catalina.servlets.DefaultServlet |
---|
checkIfMatch, checkIfModifiedSince, checkIfNoneMatch, checkIfUnmodifiedSince, checkSendfile, copy, copy, copy, copy, copy, copy, copyRange, copyRange, copyRange, copyRange, destroy, displaySize, doGet, doHead, doPost, executePartialPut, findXsltInputStream, getReadme, parseContentRange, parseRange, render, renderHtml, renderSize, renderXml, rewriteUrl, serveResource |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doTrace, getLastModified, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String DEFAULT_NAMESPACE
protected static final java.text.SimpleDateFormat creationDateFormat
protected static java.security.MessageDigest md5Helper
protected static final MD5Encoder md5Encoder
Constructor Detail |
---|
public WebdavServlet()
Method Detail |
---|
public void init() throws javax.servlet.ServletException
init
in class DefaultServlet
javax.servlet.ServletException
- if an exception occurs that
interrupts the servlet's
normal operationprotected javax.xml.parsers.DocumentBuilder getDocumentBuilder() throws javax.servlet.ServletException
javax.servlet.ServletException
protected void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
service
in class javax.servlet.http.HttpServlet
req
- the HttpServletRequest
object that
contains the request the client made of
the servletresp
- the HttpServletResponse
object that
contains the response the servlet returns
to the client
javax.servlet.ServletException
- if the HTTP request
cannot be handled
java.io.IOException
- if an input or output error occurs
while the servlet is handling the
HTTP requestServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
protected boolean checkIfHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ResourceAttributes resourceAttributes) throws java.io.IOException
checkIfHeaders
in class DefaultServlet
request
- The servlet request we are processingresponse
- The servlet response we are creatingresourceAttributes
- The resource information
java.io.IOException
protected java.lang.String getRelativePath(javax.servlet.http.HttpServletRequest request)
getRelativePath
in class DefaultServlet
request
- The servlet request we are processingprotected java.lang.String getRelativePath(javax.servlet.http.HttpServletRequest request, boolean allowEmptyPath)
getRelativePath
in class DefaultServlet
protected java.lang.String getPathPrefix(javax.servlet.http.HttpServletRequest request)
getPathPrefix
in class DefaultServlet
request
- the request to determine the path for
protected void doOptions(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
doOptions
in class DefaultServlet
req
- The requestresp
- The response
javax.servlet.ServletException
- If an error occurs
java.io.IOException
- If an IO error occursprotected void doPropfind(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected void doProppatch(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected void doMkcol(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected void doDelete(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
doDelete
in class DefaultServlet
req
- The servlet request we are processingresp
- The servlet response we are creating
javax.servlet.ServletException
- if a servlet-specified error occurs
java.io.IOException
- if an input/output error occursprotected void doPut(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
doPut
in class DefaultServlet
req
- The servlet request we are processingresp
- The servlet response we are creating
java.io.IOException
- if an input/output error occurs
javax.servlet.ServletException
- if a servlet-specified error occursprotected void doCopy(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected void doMove(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected void doLock(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected void doUnlock(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |