tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukas Mathis" <>
Subject Problem writing Webdav Servlet for Tomcat
Date Tue, 18 Oct 2005 16:26:13 GMT

I'm trying to write a Webdav Servlet for Tomcat (based on Tomcat
example code). Basically, I've written a first, very simple version
which simply serves an empty directory. Unfortunately, Windows can't
open it: When I try to open a Web Folder in Windows, it tells me
that it "Cannot connect to the Web server
http://localhost:8080/webdav. The server could not be located, or
may be too busy to respond. Please check your typing or check to
make sure the Web server is available".

Calling System.out.println() in my Webdav Servlet tells me that it
got a PROPFIND request at path /webdav, but somehow, Windows either
doesn't get an answer or doesn't understand it.

Here are the relevant parts of my code:

public class WebDavServlet extends HttpServlet {
   protected void service(HttpServletRequest req, 
         HttpServletResponse resp)
         throws ServletException, IOException {
      if (method.equals(METHOD_PROPFIND)) {
         doPropfind(req, resp);
   protected void doPropfind(HttpServletRequest req,
         HttpServletResponse resp)
         throws ServletException, IOException {
      resp.setContentType("text/xml; charset=UTF-8");
      StringBuffer buffer = new StringBuffer();
      buffer.append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n");
      buffer.append("<multistatus xmlns=\"DAV:\">\n" +
      ); resp_writer = resp.getWriter();

If anyone could shed any light on this, I would be extremely grateful.
I really am stumped.

Thanks for your time!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message