You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Robert J. Carr" <rj...@gmail.com> on 2007/06/30 07:43:50 UTC

WebdavServlet

I'd like to add the webdav servlet to my own web application.  I can
do this and it works, but it treats the root of my webapp as the root
of the dav share.  I would like to have my webapp do more than webdav,
so I was hoping I could specify that only a portion of my webapp is
visible to dav.  I initially (naively) though setting up a simple
servlet mapping would fix it, similar to this:

<servlet-mapping>
  <servlet-name>webdav</servlet-name>
  <url-pattern>/dav/*</url-pattern>
</servlet-mapping>

But then realized this has nothing to do with the share point.  So
then I thought it would be set as an init-param, but looking at the
docs there is no such parameter, but the top of WebdavServlet.java
says this:

 * Check out http://issues.apache.org/bugzilla/show_bug.cgi?id=40160
for a Filter
 * that allows you to map this servlet anywhere inside a web
application, not just
 * the /* URL pattern.

So this sounds like what I'm after.  I look at the issue and the guys
initial report seems exactly like my situation.  After that, another
guy posts a "solution" using a filter, and although I'm far from a
filter expert, this doesn't seem like a solution at all.  The code has
typos in it, so that makes me even more suspicious that it wasn't
tested.

So I'm hoping someone can provide a solution for me, or if the filter
*does* work, explain how/why, because what I've seen just seems to
cover request made for specific microsoft resources.

Thanks!

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: WebdavServlet

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Robert J. Carr [mailto:rjcarr@gmail.com] 
> Subject: Re: WebdavServlet
> 
> > Mapping it to /edit/* allows the content to be exposed at an
> > alternative url.
> 
> Sure, but the content exposed would still be the "whole of 
> the webapp", right?

Yes - allowing appropriately privileged users access.

> > The idea is that normal users access /your-app/*, a
> > system admin can edit contant via /your-app/edit/*.
> 
> Not following what a system admin has to do with anything.

Substitute "privileged user" for "system admin", and control who is
privileged via <security-constraint> elements in your web.xml file.
Constraints can be placed on sub-paths of "edit", as well as "edit"
itself, to segregate just who has webdav access to what portions of the
webapp.

> The 'edit' folder would just be implied ... both "normal users"
> and "system admin" would still be exposed to the whole of the
> webapp, right?

Correct, but only those allowed to use the "edit" path could run the
webdav servlet.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: WebdavServlet

Posted by "Robert J. Carr" <rj...@gmail.com>.
Hey Mark-

Thanks for the quick reply, and what you're saying confirms my
assumption that the filter solution that is provided isn't going to
work for me.

However, I claim that the initial bug report is *exactly* the problem
I'm having.  If the filter solution doesn't address the problem, then
why was the report labeled fixed and closed?

Also, I'm not quite following what you're saying here (which could
mean I didn't explain my problem clearly):

> The way the webdav servlet is written, it exposes the whole of the
> webapp.

Agreed, that's what I'm finding and trying to avoid.

> Mapping it to /edit/* allows the content to be exposed at an
> alternative url.

Sure, but the content exposed would still be the "whole of the webapp", right?

> The idea is that normal users access /your-app/*, a
> system admin can edit contant via /your-app/edit/*.

Not following what a system admin has to do with anything.  The 'edit'
folder would just be implied ... both "normal users" and "system
admin" would still be exposed to the whole of the webapp, right?

On 6/30/07, Mark Thomas <ma...@apache.org> wrote:
> Robert J. Carr wrote:
> > I'd like to add the webdav servlet to my own web application.  I can
> > do this and it works, but it treats the root of my webapp as the root
> > of the dav share.
>
> The way the webdav servlet is written, it exposes the whole of the
> webapp. Mapping it to /edit/* allows the content to be exposed at an
> alternative url. The idea is that normal users access /your-app/*, a
> system admin can edit contant via /your-app/edit/*.
>
> To do what you want to do would require:
> - changes to the webdav servlet
> - placing the edtiable content in a separate (sub-)context
> - blocking webdav methods for urls that should not be editable
>
> Mark
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: WebdavServlet

Posted by Mark Thomas <ma...@apache.org>.
Robert J. Carr wrote:
> I'd like to add the webdav servlet to my own web application.  I can
> do this and it works, but it treats the root of my webapp as the root
> of the dav share.

The way the webdav servlet is written, it exposes the whole of the
webapp. Mapping it to /edit/* allows the content to be exposed at an
alternative url. The idea is that normal users access /your-app/*, a
system admin can edit contant via /your-app/edit/*.

To do what you want to do would require:
- changes to the webdav servlet
- placing the edtiable content in a separate (sub-)context
- blocking webdav methods for urls that should not be editable

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org