I need to serve up pages via WebDAV starting below 
the application root.  I see other people in this and
the tomcat forum who occasionally need to do the
same so they can mix app pages and WebDAV
serving.

Separating the WebDAV pages into a separate app
works in some cases, but not all.

I found that this ALMOST works in the current WebDAV
distribution in Tomcat, but there is a problem in the
DefaultServlet.getRelativePath() call.  It uses 
request.getPathInfo() to get the path, but this seems
to have strange behavior.

In my web app I use web.xml to map URL paths to
WebDAV, e.g.,
  <servlet-mapping>
    <servlet-name>webdav</servlet-name>
    <url-pattern>/Documents/Alpha/*</url-pattern>
  </servlet-mapping>

If I access the URL /Documents/Alpha the getPathInfo()
returns /Documents/Alpha and all is well.  However, if
I try to access anything below that, e.g. 
/Documents/Alpha/Foo/bar.txt then getPathInfo throws
away the "redirection" portion of the path and returns
something like /Foo/bar.txt.

The documentation says that it should return the portion
after the servlet part.  How to interpret this with redirection
is ambiguous, but the different behavior above seems
inconsistent (it should ALWAYS throw /Documents/Alpha
away or NEVER throw it away).

I found that changing DefaultServlet.getRelativePath() to
always get the path which includes the redirection portion
makes it now work properly when it is mapped somewhere
other than the root.

Questions:

1) What should getPathInfo() be returning?

2) Can't we get a definition of the behavior of WebDAV for
these cases which allows people to map it to (multiple) places
other than root (my fix seems to behave just fine and does
the trick)???

Frank Lawlor
Athens Group, Inc.
(512) 345-0600 x151
Athens Group, an employee-owned consulting firm integrating technology
strategy and software solutions.




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to