tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C F" <gis_consult...@hotmail.com>
Subject RequestDispatcher.forward to CGI
Date Mon, 01 Jul 2002 05:50:42 GMT
Hello,

I've been trying to use the following procedure to forward a request from my 
servlet to a CGI program within the same application space....
getServletContext().getRequestDispatcher("/cgi-bin/my_cgi_prog").forward(request,response);

... which results in the following error....
"Servlet invoker is currently unavailable"

Looking at Sun's servlet tutorial, they indicate that this would be 
possible.
http://java.sun.com/docs/books/tutorial/servlets/communication/request-dispatcher.html

However, I did notice that Tomcat's documentation makes no mention of being 
able to forward requests in this manner to CGI... only other JSPs and 
servlets.  All I want is to pass the HTTP request to my CGI program via a 
servlet, the CGI program will respond with HTML and pass it back to the 
client browser via the servlet.  So I have a few questions...

1)  Has anybody been successful doing this? How?

2)  If it's not possible in the current Tomcat, is it something that might 
be available soon (I noticed that this release is Tomcat's first shot at CGI 
availability)?

2)  If it is not possible to do this in Tomcat, can anybody think of another 
solution?  Response.sendRedirect is NOT an option.  The reason I'm 
attempting this is because I want to control access and input to my CGI 
program through a servlet.  I don't want the browser calling it directly.  
I'm thinking maybe the URLConnection class might be of use, but then I still 
have the issue of controlling access to it and maybe another performance 
hit.  Or maybe I'm wrong.  Ideas?

Environment:
Tomcat 4.0.4 (standalone)
JDK 1.4
Redhat Linux 7.3

Thanks!

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message