lotsToLearn
Programmer
Hi, <br>
<br>
We use an application called SilverStream to develop and serve our web site. We have some cgi scripts form part of our web site that live outside of the SilverStream environment. <br>
<br>
What I want to do is execute these CGI scripts ( written in perl ) from a servlet. I want the results returned to the servlet and which will then deliver them to the client. I know I need to use input and output streams for this but know very little about there implementation. <br>
<br>
Here is the code that I have. It ain't much but it is a start. <br>
<br>
// Get the runtime object and execute the perl program<br>
Runtime rt = Runtime.getRuntime();<br>
Process p = rt.exec("D:\\InetPub\\<br>
// Get the inputstream from the process<br>
InputStream is = p.getInputStream();<br>
<br>
// Now this is were I am missing stuff. I need to read the input stream in such a manner that I can write it to the servlets output stream. HELP <br>
<br>
<br>
ServletOutputStream out = res.getOutputStream();<br>
<br>
<br>
I hope that this makes sense to someone out there. <br>
<br>
ALH
<br>
We use an application called SilverStream to develop and serve our web site. We have some cgi scripts form part of our web site that live outside of the SilverStream environment. <br>
<br>
What I want to do is execute these CGI scripts ( written in perl ) from a servlet. I want the results returned to the servlet and which will then deliver them to the client. I know I need to use input and output streams for this but know very little about there implementation. <br>
<br>
Here is the code that I have. It ain't much but it is a start. <br>
<br>
// Get the runtime object and execute the perl program<br>
Runtime rt = Runtime.getRuntime();<br>
Process p = rt.exec("D:\\InetPub\\<br>
// Get the inputstream from the process<br>
InputStream is = p.getInputStream();<br>
<br>
// Now this is were I am missing stuff. I need to read the input stream in such a manner that I can write it to the servlets output stream. HELP <br>
<br>
<br>
ServletOutputStream out = res.getOutputStream();<br>
<br>
<br>
I hope that this makes sense to someone out there. <br>
<br>
ALH