You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ken Gibson <ke...@fxfn.com> on 2006/03/06 18:03:48 UTC

cgi-servlet environment parameters

Good morning.

 

I'm working with Tomcat 4.1.31 and am trying to catch 500 errors for
custom error pages. We host around 400 portals in one instance (kudos to
the developers, by the way, it runs great!) 

 

The idea is that the Perl script would create a site on the fly with
little content in the event of a 500. The original request, then, would
be something akin to http://mydomain.com/portal_a/index.jsp. I've got
the cgi-servlet set up to run a Perl script and have created a simple
JSP that returns 

 

response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR)

 

to create the 500 for testing. The Perl script is set to pick up the
original URL requested and return some content specific for portal_a.
However, the environment does not seem to contain the URL of the
original request (i.e., REQUEST_URI or PATH_INFO), as below:

 

runCGI(envp=[{HTTP_USER_AGENT=Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7, HTTP_ACCEPT_ENC
DING=gzip,deflate, REQUEST_METHOD=GET, AUTH_TYPE=,
HTTP_ACCEPT_LANGUAGE=en-us,e ;q=0.5, SERVER_NAME=harrier.mesas.com,
SERVER_SOFTWARE=TOMCAT, HTTP_KEEP_ALIVE= 00,
HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7,
HTTP_HOST=harrier.mesas com:3233, GATEWAY_INTERFACE=CGI/1.1,
X_TOMCAT_SCRIPT_PATH=/private-1/portal/pro

uction35/www/500.cgi, REMOTE_ADDR=10.20.2.65, SERVER_PROTOCOL=HTTP/1.1,
PATH_IN O=, REMOTE_HOST=kengibson100625.mesas.mis, QUERY_STRING=var1=2,
HTTP_CONNECTION keep-alive, SERVER_PORT=3233,
HTTP_COOKIE=JSESSIONID=5065D8892D6F8D0FD891483596

283A5, CONTENT_TYPE=, CONTENT_LENGTH=,
HTTP_ACCEPT=text/xml,application/xml,app

ication/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5,
SCRIPT_ AME=/cgi-bin/500.cgi, REMOTE_USER=, REMOTE_IDENT=}],
command=/private-1/portal/

roduction35/www/500.cgi)

 

Oddly, adding bogus parameters to the end of the request (var1=2) gets
passed to the cgi-servlet in the QUERY_STRING parameter.

 

Any help in finding the original request is greatly appreciated. 

 

Thanks

 

 

Ken


Re: cgi-servlet environment parameters

Posted by Mark Thomas <ma...@apache.org>.
Ken Gibson wrote:
> However, the environment does not seem to contain the URL of the
> original request (i.e., REQUEST_URI or PATH_INFO), as below:

Looking at the 4.1.31 source, PATH_INFO should be there but
REQUEST_URI is never set.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org