Bug 28140 - Problems when WebDAV servlet is not the default servlet
Summary: Problems when WebDAV servlet is not the default servlet
Status: RESOLVED FIXED
Alias: None
Product: Slide
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.0
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: Slide Developer List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-01 19:04 UTC by Robert Flaherty
Modified: 2004-11-16 19:05 UTC (History)
1 user (show)



Attachments
Sample input/output of first Windows webdav call (31.44 KB, text/plain)
2004-05-07 15:52 UTC, Robert Flaherty
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Flaherty 2004-04-01 19:04:02 UTC
Originally posted in 28079, but the patch that was applied was different from 
what I found.

In the XML returned in the reponse the following occur:

1) Some servlet paths being written out as null
<D:principal-collection-set>
    <D:href>/hab-samplesnull/users</D:href>
    <D:href>/hab-samplesnull</D:href>
    <D:href>/hab-samplesnull/roles</D:href>
</D:principal-collection-set>

2)Some servlet paths being written out with the server URL
<D:inherited>
    <D:href>/hab-sampleshttp%3A//localhost%3A8080/files</D:href>
</D:inherited>
<D:principal>
    <D:href>/hab-sampleshttp%3A//localhost%3A8080/roles/HAB_User</D:href>
</D:principal>

Searching the code I think that the calls to WebdavUtils.getAbsolutePath() in 
AbstractReport, PrincipalMatchReport, PrincipalPropertySearchReport, 
PropertyHelper and PropertyRetrieverImpl should be passing in servlet path not 
the server URL.

Also the nulls look like they're coming from calls to 
WebdavUtils.getAbsolutePath() in PropertyHelper that passing null for the 
servlet path.

I think that all references to serverURl need to be changed to servletPath in 
the above mentioned files, as well as servletPath needs to be passed in to the 
methods which used null.  Then, all calls to any of those methods would need 
to be checked.  Perhaps replacing all methods that currently take contextPath 
and serverURL should be replaced to take the request.  Then at compile time 
you can easily find all the callers of those methods.
Comment 1 Oliver Zeigermann 2004-04-02 07:12:02 UTC
Could you please verify this bug still exists in the latest version in the
release branch?!
Comment 2 Robert Flaherty 2004-05-07 15:49:59 UTC
Just tried the new 2.0 release and it looks like many of the serverURL-
>servletPath issues were resolved.  But there are several still lurking 
about.  I'm going to attach a sample input/output using Windows Webdav 
support.  I would assume that Webdav is consistent with hrefs in that they 
should be including the contextPath/servletPath everywhere.  Highlights that I 
think are wrong are:

1) No contextPath/servletPath
<D:href>/roles/HAB_Admin</D:href>

2) No servletPath
<D:href>/hab-samples/users/unauthenticated</D:href>

3) Null servletPath
<D:href>/hab-samplesnull/users</D:href>

There are 4 occurances of "null, sConf" in PropertyHelper which I think is the 
null problem.

I had suggested before about condensing passing context path and servlet path 
into just passing in the request.  Many places pass "String servletPath, 
String contextPath", whereas the WebdavUtils.getAbsolutePath takes "String 
contextPath, String servletPath".  You know somewhere these are or will be 
reversed.  Conceptually at least these should be reversed as context path 
comes first, then servlet path.  But, I think converting to request will be 
much less error prone.

Comment 3 Robert Flaherty 2004-05-07 15:52:25 UTC
Created attachment 11454 [details]
Sample input/output of first Windows webdav call
Comment 4 Stefan L 2004-06-14 12:52:32 UTC
I have commited fixes for that issue to the cvs head.

I introduced the "slideContextPath" as the path prefix of all 
slide uris exposed via webdav, and replaced all uses of the 
contextPath - servlet path pair with that new slideContextPath.

Testcases now running (as default and as nondefault servlet) are
funtional, deltav/functional .

A known issue remains the SEARCH method which I try to resolve next.

Robert, it whould be great you could recheck your cases and 
let me know if thera are still problems.

Regards, Stefan
Comment 5 Jessica Lee 2004-07-28 16:10:27 UTC
Tried 2.1M1 version of Slide, using source for PropertyHelper.java
 * $Header: /home/cvspublic/jakarta-
slide/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java,v 1.69 
2004/05/12 12:50:41 pnever Exp $
 * $Revision: 1.69 $
 * $Date: 2004/05/12 12:50:41 $

1) Some servlet paths being written out as null --- IS STILL NOT FIXED
   See lines 1840,1872,1877 and 1881 in PropertyHelper.java specified above.

2) HRefs in the following properties are still incorrect.  They are as follows:
   owner
   creationuser
   modificationuser

   See lines 1926, 1936 and 1947 in PropertyHelper.java specified above.

3) Inconsistency with unauthenticated.  Some properties return 
<D:href>contextPath/servletPath/users/unauthenticated</D:href> or 
<D:unauthenticated />.  For example owner and creationuser return 
<D:unauthenticated /> while modificationuser returns 
<D:href>contextPath/servletPath/users/unauthenticated</D:href>.  The request 
used was <?xml version="1.0" encoding="utf-8" ?><D:propfind 
xmlns:D="DAV:"><D:allprop/></D:propfind> on /files as the resource.  Did some 
digging and found on lines 1922 and 1933 of PropertyHelper.java, NodeProperty 
is null.
Comment 6 Stefan L 2004-09-28 12:27:07 UTC
Now I would claim that this issue is fixed.

Testcases functional, deltav and bind are passing if servlet is 
not the dafault one.
dasl test cases produce the same errors as with the servlet as default,
so thats not this issue.

Stefan.