You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Martin Algesten <pu...@taglab.com> on 2003/07/03 11:35:24 UTC

WebdavServlet.java, form based login and files from other contexts

In a recent client project I used the WebdavServlet for the first time 
and encountered some configuration issues which lead me down the path 
of doing some patches to it.

Our client's site uses form based login which doesn't play well with 
WebDAV. All clients I've ever seen only do basic authentication. The 
problem is really that one web app can only have one type of login (I 
would like to be able to set different login types for different 
security-constraints in the same app). Changing to basic login is not 
really an option since that makes the site less slick, and part of the 
project was explicitly to do form based login.

The only way I can see to solve the problem was to add another 
parameter into the WebdavServlet so that it can server files of another 
context, in my configuration a "/webdav" webapp serves files off the 
ROOT ("/") context.

The changes to the WebdavServlet to do this are very trivial, add 
another parameter "fileContext" and override the getResources() method 
in the DefaultServlet with an exact copy except that rather than 
grabbing the local context, the method can now grab a foreign one if 
"fileContext" is set.

The added bonus with this solution is that .jsp files can be served 
from the the ROOT context through jasper, while the source code can be 
served in my /webdav context.

Is this an okay solution? Is it the right way of doing it? ... 
Shouldn't really the WebdavServlet be able to serve an arbitrary path 
of the file system? Have anyone else had the same problem, should the 
WebdavServlet be possible to configure along these lines?

Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org