tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phillip Qin <>
Subject RE: Tomcat cgi NPH support
Date Tue, 28 Sep 2004 19:36:39 GMT
The legacy that I inherited from the "crazy" perl guy always has these lines
of codes

      print "Status: 302 Moved Temporarily\n";
      print "Location:\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) {
                            } else {
                                line.substring(line.indexOf(":") +
                        } 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 [] 
Sent: September 28, 2004 2:37 PM
To: 'Tomcat Users List'
Subject: RE: Tomcat cgi NPH support

From: Phillip Qin [] 
> 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 ;)


To unsubscribe, e-mail:
For additional commands, e-mail:


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message