Running process in a web application

Discussion in 'Java' started by vincente13@gmail.com, Dec 13, 2006.

  1. Guest

    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?
    , Dec 13, 2006
    #1
    1. Advertising

  2. Ben_ Guest

    > 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 ?
    Ben_, Dec 13, 2006
    #2
    1. Advertising

  3. Daniel Pitts Guest

    Ben_ wrote:
    > > 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 ?


    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.
    Daniel Pitts, Dec 13, 2006
    #3
  4. Guest

    Ben_ wrote:
    > 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?
    , Dec 14, 2006
    #4
  5. Ben_ Guest

    I don't understand your questions.
    Ben_, Dec 14, 2006
    #5
  6. Ben_ Guest

    > 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.
    Ben_, Dec 14, 2006
    #6
  7. Daniel Pitts Guest

    wrote:
    > Ben_ wrote:
    > > 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?


    Please try to rephrase your question (or point), so that it makes sense.
    Daniel Pitts, Dec 14, 2006
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jona
    Replies:
    2
    Views:
    793
  2. John English
    Replies:
    0
    Views:
    5,202
    John English
    Nov 7, 2005
  3. Replies:
    1
    Views:
    386
    Richard Brown
    May 23, 2006
  4. Ron Vecchi
    Replies:
    0
    Views:
    156
    Ron Vecchi
    Aug 4, 2003
  5. Victor Hooi
    Replies:
    1
    Views:
    129
    Nobody
    Feb 10, 2013
Loading...

Share This Page