Stephen Bartlett wrote:
> Your servlet can communicate with CGI using 2 methods:
>
> 1. Make a HTTP request (connection to URL and then read and write from it)
>
This works if the PERL script is actually a CGI. If it's a standalone app, see
below.
>
> 2. Use the RequestDispatch object - i've not used it but from what i
> understand it should do the job if the resource is on the same server -
> like i said i've not used it so don't quote me on that.
>
Generally, RequestDispatcher is used to access other servlets and JSPs in the
same servlet context, not external apps.
>
> anyway, i don't think this sort of thing is out of the ordinary - it's a
> requirement for the system i'm developing also.
>
The most common mechanism for executing separate applications in your server's
OS (PERL or not makes no difference) is to use the java.lang.Runtime class's
facilities to start an external process and connect to it's input and ouput
channels. There is an example of this in the Java Language Tutorial
(http://java.sun.com/docs/books/tutorial) as well as other places.
>
> good luck,
> steve.
>
Craig McClanahan
>
> -----Original Message-----
> From: Mike Hogarth [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 29 November 1999 17:20
> To: [EMAIL PROTECTED]
> Subject: Running Perl scripts from a servlet
>
> I know this sounds strange, but I have the need to run a Perl script that is
> invoked by a servlet. Not my choice. Forced on me by a content vendor (they
> use Perl). Does anyone know of a servlet that does this or whether the new
> forward() method will work.
>
> TIA,
> Mike H
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html