DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28079>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28079

Problems if WebdavServlet is not mapped to "/"

           Summary: Problems if WebdavServlet is not mapped to "/"
           Product: Slide
           Version: 2.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: WebDAV Server
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


As stated in a mail there are some problems if the WebdavServlet is not mapped
to be the default servlet of a web application.

The problem occurs because often context path and the servlet path are
not considerd both.

Some of the problems can be fixed with the patch below. The functional 
test cases are running now in both configs (as default and as non default
servlet) with the exception of the SEARCH method. 

With SEARCH there is a problem that not enough information is passed
in to evaluate the correct slide-context (i.e. context + servlet path).

TODO remains the other testcases at which I'm willing to work on, if 
there is no one who works currently on this issue.

Index: src/webdav/server/org/apache/slide/webdav/WebdavServlet.java
===================================================================
retrieving revision 1.54.2.2
diff -u -r1.54.2.2 WebdavServlet.java
--- src/webdav/server/org/apache/slide/webdav/WebdavServlet.java        29 Mar 2004
14:45:51 -0000  1.54.2.2
+++ src/webdav/server/org/apache/slide/webdav/WebdavServlet.java        30 Mar 2004
13:11:18 -0000
@@ -131,6 +131,9 @@
         SimpleDateFormat sdf = new SimpleDateFormat();
         if( token.getLogger().isEnabled(LOG_CHANNEL, Logger.DEBUG) )
             token.getLogger().log("==> "+req.getMethod()+" start:
"+sdf.format(new Date(System.currentTimeMillis()))+"
["+Thread.currentThread().getName()+"]", LOG_CHANNEL, Logger.DEBUG);
+
+        req.setAttribute("slide_uri", WebdavUtils.getRelativePath(req, 
+                                     (WebdavServletConfig)getServletConfig()));
         
         try {
             
@@ -337,9 +340,6 @@
                                  token.getName());
                 // attributes for general use
                 req.setAttribute("slide_namespace", token.getName());
-                req.setAttribute
-                    ("slide_uri", WebdavUtils.getRelativePath
-                         (req, (WebdavServletConfig)getServletConfig()));
                 directoryBrowsingTemplate.forward(req, res);
             } else {
                 try {
Index: src/webdav/server/org/apache/slide/webdav/filter/LogFilter.java
===================================================================
retrieving revision 1.6.2.1
diff -u -r1.6.2.1 LogFilter.java
--- src/webdav/server/org/apache/slide/webdav/filter/LogFilter.java     5 Feb 2004
16:11:22 -0000  1.6.2.1
+++ src/webdav/server/org/apache/slide/webdav/filter/LogFilter.java     30 Mar 2004
13:11:18 -0000
@@ -129,9 +129,6 @@
         String datetime = df.format( new Date() );
         String method = req.getMethod();
         String uri = req.getRequestURI();
-        String path = req.getServletPath();
-        if( "".equals(path) )
-            path = "/";
         Principal p = req.getUserPrincipal();
         String principal = (p != null ? p.getName() : "");
         String contentlength = req.getHeader( "Content-Length" );
@@ -147,7 +144,9 @@
         String detail = resp.getStatusText();
         if( detail == null || "".equals(detail) )
             detail = message;
-
+        String path = (String)req.getAttribute("slide_uri"); // set by
WebdavServlet
+        if( path == null ) path = "?"; 
+        if( "".equals(path) ) path = "/";
 
         long end = System.currentTimeMillis();
         logLine( (end-start), status, thread, method, datetime, uri, path,
contentlength, principal,
Index: src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java
===================================================================
retrieving revision 1.20.2.2
diff -u -r1.20.2.2 AbstractWebdavMethod.java
--- src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java
23 Mar 2004 13:32:08 -0000      1.20.2.2
+++ src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java
30 Mar 2004 13:11:20 -0000
@@ -370,15 +370,11 @@
 
 
     /**
-     * Return an absolute URL (absolute in the HTTP sense) based on a Slide
+     * Return an absolute path (absolute in the HTTP sense) based on a Slide
      * path.
      */
-    public String getFullPath(String path) {
-
-        if (path.startsWith("/"))
-            return WebdavUtils.encodeURL(req.getContextPath() + path);
-        else
-            return WebdavUtils.encodeURL(req.getContextPath() + "/" + path);
+    public String getFullPath(String slidePath) {
+       return WebdavUtils.getAbsolutePath(slidePath, req, getConfig());
     }
 
 
Index: src/webdav/server/org/apache/slide/webdav/util/PropertyRetrieverImpl.java
===================================================================
retrieving revision 1.31.2.2
diff -u -r1.31.2.2 PropertyRetrieverImpl.java
--- src/webdav/server/org/apache/slide/webdav/util/PropertyRetrieverImpl.java   14
Mar 2004 18:14:56 -0000 1.31.2.2
+++ src/webdav/server/org/apache/slide/webdav/util/PropertyRetrieverImpl.java   30
Mar 2004 13:11:22 -0000
@@ -578,9 +578,9 @@
             if( propertyValue.toString().indexOf('<') >= 0 ) {
                 try {
                     XMLValue xmlValue = new XMLValue(propertyValue.toString(),
valueDefaultNamespace);
-                    if (AbstractResourceKind.isLiveProperty(propertyName)) {
-                        convertHrefValueToAbsoluteURL (xmlValue, contextPath,
servletPath, config);
-                    }
+//                    if (AbstractResourceKind.isLiveProperty(propertyName)) {
+//                        convertHrefValueToAbsoluteURL (xmlValue, contextPath,
servletPath, config);
+//                    }
                     Iterator iterator = xmlValue.iterator();
                     while (iterator.hasNext()) {
                         Object o = iterator.next();

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

Reply via email to