You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Moley Harey <mo...@gmail.com> on 2008/07/25 16:10:03 UTC

How to configure Toncat to accept HTTP PUT requests?

Hi folks!

I have a simple Java client that execute a HTTP PUT request to upload a file
under Tomcat webapps folder, the thing is that every time I try to upload
the file I get the response code "Forbidden 403".

I have read that Tomcat do not come by default with the HTTP PUT feature
enabled (which is something normal for security reasons) but if I need to
enable this for a single folder under "webapps" that is going to be used as
a repository accesible via HTTP, how can I configure that? I am using Tomcat
5.5.7


Thanks in advance!

--

Re: How to configure Toncat to accept HTTP PUT requests?

Posted by Moley Harey <mo...@gmail.com>.
Hi Charles,

I created  a new servlet context and added the configuration you sent me in
its web.xml and it worked fine ;-)

Thanks a lot  for your help!

2008/7/25 Caldarale, Charles R <Ch...@unisys.com>

> > From: Moley Harey [mailto:moleyharey@gmail.com]
> > Subject: How to configure Toncat to accept HTTP PUT requests?
> >
> > if I need to enable this for a single folder under "webapps"
> > that is going to be used as a repository accesible via HTTP,
> > how can I configure that? I am using Tomcat 5.5.7
>
> (Thank you for telling us your Tomcat version up front.)
>
> Look in conf/web.xml for the DefaultServlet parameters, in particular
> readOnly.  Copy the <servlet> section for it to the WEB-INF/web.xml for the
> webapp that you want to be able to dump things into.  Change the
> <servlet-name> to something unique, and set the readOnly parameter value to
> true.  Add a <servlet-mapping> for that unique name with a <url-pattern> of
> "/" (without the quotes) and you should be able to clobber whatever you want
> in just that webapp.
>
> You might also want to investigate various webdav-based mechanisms as an
> alternative.
>
>  - 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
>
>


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
El tiempo es vida y la vida se lleva en el corazon!

http://moleyharey.blogspot.com/

RE: How to configure Toncat to accept HTTP PUT requests?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Moley Harey [mailto:moleyharey@gmail.com]
> Subject: How to configure Toncat to accept HTTP PUT requests?
>
> if I need to enable this for a single folder under "webapps"
> that is going to be used as a repository accesible via HTTP,
> how can I configure that? I am using Tomcat 5.5.7

(Thank you for telling us your Tomcat version up front.)

Look in conf/web.xml for the DefaultServlet parameters, in particular readOnly.  Copy the <servlet> section for it to the WEB-INF/web.xml for the webapp that you want to be able to dump things into.  Change the <servlet-name> to something unique, and set the readOnly parameter value to true.  Add a <servlet-mapping> for that unique name with a <url-pattern> of "/" (without the quotes) and you should be able to clobber whatever you want in just that webapp.

You might also want to investigate various webdav-based mechanisms as an alternative.

 - 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