Running process in a web application

V

vincente13

Hi all,

I have this web application where the web application has a executable
file that will be executed upon clients requests through the web and
produce a output for the client.

Right now in the servlet doPost method is simply

String cmd = "abc.exe input.txt output.txt"
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(cmd);

Should i actually use Thread objects to do this execution?
 
B

Ben_

a executable
file that will be executed upon clients requests through the web and
produce a output for the client.

This is called CGI. Put the exe in the cgi-bin directory of Apache and
you're finished.
Do you really need to wrap the call with a Servlet ?
 
D

Daniel Pitts

Ben_ said:
This is called CGI. Put the exe in the cgi-bin directory of Apache and
you're finished.
Do you really need to wrap the call with a Servlet ?

You are making an assumption that because you're running behind Apache,
everyone else is. Also, the servlet may contain more logic to determine
what command to run.

I would tend to suggest that the OP look into CGI, or porting the
executable file to a servlet instead. It is a much cleaner approach.
 
A

ahjiang

Ben_ said:
This is called CGI. Put the exe in the cgi-bin directory of Apache and
you're finished.
Do you really need to wrap the call with a Servlet ?

Why would be the problem putting the exe in the cgi-bin directory?

The servlet serves request from the users and tts the only way to
execute the executable? It is not a wise choice?
 
B

Ben_

You are making an assumption that because you're running behind Apache,
everyone else is. No.

Also, the servlet may contain more logic to determine
what command to run.
Certainly. Hence my question, "do you really need ...".
I would tend to suggest that the OP look into CGI, or porting the
executable file to a servlet instead. It is a much cleaner approach.
Re-engineering is an option indeed.
 
D

Daniel Pitts

Why would be the problem putting the exe in the cgi-bin directory?

The servlet serves request from the users and tts the only way to
execute the executable? It is not a wise choice?

Please try to rephrase your question (or point), so that it makes sense.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top