Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 90965 invoked from network); 28 Sep 2004 19:37:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 28 Sep 2004 19:37:44 -0000 Received: (qmail 50825 invoked by uid 500); 28 Sep 2004 19:36:52 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 50755 invoked by uid 500); 28 Sep 2004 19:36:51 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 50741 invoked by uid 99); 28 Sep 2004 19:36:51 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=HTML_60_70,HTML_MESSAGE,MIME_HTML_NO_CHARSET X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [66.46.24.147] (HELO shareowner.com) (66.46.24.147) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 28 Sep 2004 12:36:51 -0700 Received: from exchange.int.shareowner.com (gw.shareowner.com [66.46.24.163]) by shareowner.com (Postfix) with ESMTP id 5355C2360C for ; Tue, 28 Sep 2004 15:36:52 -0400 (EDT) Received: by exchange.int.shareowner.com with Internet Mail Service (5.5.2656.59) id ; Tue, 28 Sep 2004 15:36:48 -0400 Message-ID: From: Phillip Qin To: 'Tomcat Users List' Subject: RE: Tomcat cgi NPH support Date: Tue, 28 Sep 2004 15:36:39 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2656.59) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C4A592.79AA7900" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C4A592.79AA7900 Content-Type: text/plain The legacy that I inherited from the "crazy" perl guy always has these lines of codes print "Status: 302 Moved Temporarily\n"; print "Location: http://www.whatever.com\n\n"; I made a quick fix to my CGIServlet ... } else if (line.indexOf(":") >= 0) { // PQ: quick fix for 302 redirect if (line.substring(0, line.indexOf(":")).trim().compareToIgnoreCase("STATUS")==0 && line.indexOf("302")>0) { response.setStatus(302); } else { response.addHeader (line.substring(0, line.indexOf(":")).trim(), line.substring(line.indexOf(":") + 1).trim()); } } else { ... I am not sure if the above code applies to any one else so I am reluctant to patch Tomcat. -----Original Message----- From: Mark Thomas [mailto:markt@apache.org] Sent: September 28, 2004 2:37 PM To: 'Tomcat Users List' Subject: RE: Tomcat cgi NPH support From: Phillip Qin [mailto:Phillip.Qin@shareowner.com] > I am curious why NPH support is so difficult to implement in > CgiServlet? Just because something isn't done, it doesn't necessarily mean it is difficult. A number of 'extra' servlets provided with Tomcat (CGI, webDAV, etc) are not 100% complete. It all comes down to who wants/needs to do the development for the bits that are missing. > Is is OK that I simply add a conditional check, i.e. if line contains > HTTP/1.1 302 then setStatus(302)? That sounds like parsing the header to me. Given "NPN"="Non-parsed headers" that doesn't feel right. I had always assumed that NPN support would involve passing the output from the script directly to the client but haven't really given it any great amount of thought. As ever, patches are always welome ;) Mark --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org !DSPAM:4159af8d171121566911362! ------_=_NextPart_001_01C4A592.79AA7900--