You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Sam Coward <sa...@atnet.net.au> on 2003/08/11 10:19:13 UTC

Multiple WebDAV Servlets?

Hello slide-dev!
    I'm a happy-go-lucky developer who just loves to meddle with open 
source projects, I don't have qualifications, I guess you could say I'm 
just a hack. One such project I've been experimenting with over the 
months is Cocoon, and particularly of late, the slide integration aspect 
of Cocoon. Contained within are instructions which add a non-default 
instance of the Slide WebDAV servlet to the cocoon web descriptor. I 
tried this, and was overjoyed to have web folders now connecting to the 
same store that cocoon was using. (This is all running with Tomcat 
4.1.24 and JDK1.4.1, btw)

    To get to my point, I went on to configure a few other namespaces in 
the domain configuration, which can all be accessed just fine from 
cocoon using its' SlideSource implementation. However, when I tried to 
add more servlet descriptors to access these by Webdav, and mapped these 
to different servlet paths (see attached web.xml), for some reason they 
all seemed to access the default repository, regardless of the namespace 
parameter in each servlet instances' configuration.

    I tried whacking this into my debugger and found some curious code 
in o.a.s.webdav.WebdavServlet.init() ~ line 118 (i.e. I just don't 
understand all of it):
[---snip---]
        token = (NamespaceAccessToken)
            getServletContext().getAttribute(ATTRIBUTE_NAME);
        if (token == null) {
            // Dafault initialization
            String namespaceName = null;
            String domainConfigFile = null;
            value = getInitParameter("namespace");
            if (value != null) {
                namespaceName = value;
            }
            value = getInitParameter("domain");
            if (value != null) {
                domainConfigFile = value;
            }
                getServletContext().setAttribute(ATTRIBUTE_NAME, token);
[---snip---]

    For some reason the servletContext already has the 
org.apache.slide.NamespaceAccessToken attribute always set. Is this 
because the domain is being initialized first when Cocoon (the default 
servlet for the context) starts up? I've commented out the line, and 
this has the effect of using the parameters as defined in web.xml, but 
I'm not too sure if this has a negative impact (possibly security hole?) 
that I'm unaware of? I'm sorry if this is a Cocoon problem, I really 
have no clue,  but the FIXME comment just above the code prompted me to 
try posting here first. I can post the domain config too, but I already 
feel naughty by attaching a 16k web.xml.

Sam