DO NOT REPLY [Bug 40160] - Webdav Context path must be /*

2006-12-26 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=40160


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2006-12-26 06:22 ---
Peter, thank you for posting the filter: I like it as a nice, clean solution to
an unfortunate (but non-Tomcat) problem.   Andrew, thank you for posting your
suggestions: the second one is good and as you've noted, it's already been
implemented.  I hope Peter's filter works well for you.  I'm going to link to it
from the actual WebdavServlet class JavaDoc as well.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 40160] - Webdav Context path must be /*

2006-09-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=40160





--- Additional Comments From [EMAIL PROTECTED]  2006-09-08 13:42 ---
This is actually a Micorosft problem, and it is du to the implementation of the 
MS Client, which requests some information against the root "/", regardles of 
the resource and the real root of WebDAV. To solve this problem, I am using a 
simple Filter to filter the MS WebDAV requests:

/**
 * The webdav interceptor blocks some FrontPage requests and determinate the 
encoding of the underlying request
 *
 */
public class WebdavInterceptor implements Filter {

public static final String MICROSOFT_PROTOCOL_AGENT = 
"Microsoft Data Access Internet Publishing Provider Protocol Discovery";

/** Creates a new instance of LoginInterceptor */
public WebdavInterceptor()
{
}

public void init(javax.servlet.FilterConfig filterConfig) throws 
javax.servlet.ServletException
{
}

public void destroy()
{
}

/** Filter some invalid calls from the Microsoft WebDAV clients (Windows 
2000, Windows XP and Office 2003) */
public void doFilter(ServletRequest servletRequest, ServletResponse 
servletResponse, 
FilterChain filterChain) throws IOException, ServletException
{
HttpServletRequest request = (HttpServletRequest)servletRequest;
String path = request.getServletPath();
if (path != null) {
if (path.endsWith("/index.jsp")) {
// a very strange microsoft webdav handling... (because of the 
front page extensions!)
// Microsoft (protocol discoverer) is asking the root of the 
server
// whether it can handles a WebDAV, so we have to catch it 
here. Unfortunately we can't
// redirect the root URL ("/") to a servlet, because we will 
intercept any other
// path handling...
String agent = request.getHeader("user-agent");
if (MICROSOFT_PROTOCOL_AGENT.equals(agent)) {
HttpServletResponse response = (HttpServletResponse)
servletResponse;
response.addHeader("DAV", "1,2");

response.addHeader("Allow", "OPTIONS, TRACE, PROPFIND");
response.addHeader("MS-AUTHOR-VIA", "DAV");
return;
}
}
// block, front page and m$ office extensions requests...
if (path.startsWith("/_vti") || path.startsWith("/MSOffice")) {
((HttpServletResponse)servletResponse).setStatus
(HttpServletResponse.SC_NOT_FOUND);
return;
}
}

request.setCharacterEncoding(WebdavServlet.getEnconding(request));
filterChain.doFilter(servletRequest, servletResponse);
}

}

Please note, that the root "/" is mapped to "/index.jsp", this is the standard 
welcome file whithin my container. Thus the filter is mapped to:
  
webdavFilter
*.jsp
  

and also to the WebDAV Servlet:
  
webdavFilter
webdav
  

The WebDAV servket should map additionaly the following paths:
  
webdav
/_vti_inf.html
  
  
webdav
/_vti_bin/*
  
  
webdav
/MSOffice/*
  


I hope, this helps you. My WebDAV root is for instance "/webdav/*", and it 
works within a container togther with a web application.

Regards
Peter


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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