aspose file tools*
The moose likes Servlets and the fly likes Using Runtime.exec in  a web application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Using Runtime.exec in  a web application" Watch "Using Runtime.exec in  a web application" New topic
Author

Using Runtime.exec in a web application

RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
I tried to open a browser in a servlet




This had printed the Hai on the browser but didn't open the browser .

Is there anything wrong in my code?

If you want something you never had do something which you had never done
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Exactly where did you expect the process to execute??

Servlet code gets executed on the server, sending the response ("Hai") to the client.

You will need Javascript or some other technology to start processes on the client side.

Bill
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
William Brogden wrote:Exactly where did you expect the process to execute??

Servlet code gets executed on the server, sending the response ("Hai") to the client.

You will need Javascript or some other technology to start processes on the client side.

Bill


So you mean to say that it is not possible to use Runtime inside the web application.??
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
Runtime.exec works fine in a web app. But you can't use it to execute processes on the client, because it runs on the server.
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
Ulf Dittmer wrote:Runtime.exec works fine in a web app. But you can't use it to execute processes on the client, because it runs on the server.


Hey Thank you very much . You mean to say for purposes like running Batch Commands from servlets/JSP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using Runtime.exec in a web application