Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 34212 invoked from network); 2 Jul 2000 19:54:37 -0000 Received: from lukla.sun.com (192.18.98.31) by locus.apache.org with SMTP; 2 Jul 2000 19:54:37 -0000 Received: from centralmail1.Central.Sun.COM ([129.147.62.10]) by lukla.Sun.COM (8.9.3+Sun/8.9.3) with ESMTP id NAA10573 for ; Sun, 2 Jul 2000 13:54:37 -0600 (MDT) Received: from esun1as-mm. (esun1as-mm.Central.Sun.COM [129.147.34.144]) by centralmail1.Central.Sun.COM (8.9.3+Sun/8.9.3/ENSMAIL,v1.7) with SMTP id NAA19886 for ; Sun, 2 Jul 2000 13:54:36 -0600 (MDT) Received: from eng.sun.com by esun1as-mm. (SMI-8.6/SMI-SVR4) id NAA06827; Sun, 2 Jul 2000 13:54:58 -0600 Message-ID: <395F9E08.8B5876@eng.sun.com> Date: Sun, 02 Jul 2000 12:54:48 -0700 From: "Craig R. McClanahan" X-Mailer: Mozilla 4.72 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-dev@jakarta.apache.org Subject: Re: Status code 207 References: <395F4BAE.F034FD2D@epiuse.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Theunis W de Jongh wrote: > Hi all > > If I need to return a status code that is not supported in the > Servlet2.2 API, how do I go about it ? > > Reason I ask, is that in order for a DAV compliant message header to > be generated, status code 207 needs to be returned to the client. > > The first line of the header needs to be : > > HTTP/1.1 207 Multi-status > The call you are looking for is response.sendError(207, "Multi-status"); This sets the HTTP status code (and corresponding message) that will be included in the response. > > Is the solution to just not set the status parameter in the response > and add the above to the header. What method would be used to add the > single line, instead of setHeader( String, String )? > > Further on, how can one set the order of header strings in the header ? > The DAV servlet I am currently modifying sets the header contents in > a specific order, but they arrive at the client in a different order > than the setting order. > It's not clear that there are any guarantees in the servlet API about the order in which headers are delivered versus the order in which they are set. The container is free to do what it wants. In practice, what happens is that the headers are accumulated in a Hashtable keyed by header name, so the output order ends up being the order in which the headers are enumerated. > > Tomcat also appends its own header lines, among others Servlet-Engine > and Date. I also set a Date header, thus two headers arrive client > side. Is there a way to suppress the Tomcat generation of headers, also > the setting of status code to 200 ? > If you specify a header in a response.setHeader() call with the same name as one already set, the old one should be replaced -- so whoever sets it last should win. > > If there is a documentation set discussing these issues, please point > me to it. > The starting place would be the relevant standards for HTTP/1.1 (RFC 2616) and the servlet 2.2 specification. Beyond that you will need to look at the Tomcat source code to see what is really happening, and suggest changes you think might be appropriate. For WebDAV in particular, you might also be interested in the Slide project (also hosted at the Jakarta web site), which supports a content management API, and a WebDAV servlet, that runs on Tomcat or any other 2.2- based servlet container. It is nearing alpha release. For more info, see http://jakart.apache.org/struts > > Apologies if these issues have been addressed previously. > Any replies appreciated. > > Kind regards, > Theunis de Jongh. > Craig McClanahan