You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Phillip Qin <Ph...@shareowner.com> on 2004/09/28 18:45:55 UTC
Tomcat cgi NPH support
I am curious why NPH support is so difficult to implement in CgiServlet? In
CgiServlet.CgiRunner, there are lines of code commented out
if (line.startsWith("HTTP")) {
//TODO: should set status codes (NPH support)
/*
* response.setStatus(getStatusCode(line));
*/
}
I definitely need setStatus because most of my legacy scripts using 302
redirect. Without NPH support, my reponse header is
HTTP/1.1 200 OK
...
Status: 302...
only blank page will display.
Is is OK that I simply add a conditional check, i.e. if line contains
HTTP/1.1 302 then setStatus(302)?
Regards,
PQ
RE: Tomcat cgi NPH support
Posted by Mark Thomas <ma...@apache.org>.
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