aspose file tools*
The moose likes Servlets and the fly likes How to Run a shell script from a servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to Run a shell script from a servlet?" Watch "How to Run a shell script from a servlet?" New topic
Author

How to Run a shell script from a servlet?

vishal goyal
Greenhorn

Joined: Aug 13, 2001
Posts: 12
Hi,
Please let me know how to run a shell script from a servlet. Also please let me know how a servlet can get into the server to run the shell script as it would require the id-password for that.
Thanks and regards,
vishal
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

The mechanism is exactly the same as for standalone java. You get the JavaRuntime object and invoke its exec() method. The security context is that of the servlet server - anything else would most easily be acomplished by calling a glue script in that context that suexec's the actual script.


Customer surveys are for companies who didn't pay proper attention to begin with.
vishal goyal
Greenhorn

Joined: Aug 13, 2001
Posts: 12
Hi Tim,
Thanks for help.
Still, some more help needed. Please give me some code snippet demonstrating this solution.
Am able to use exec() but am not aware of glue script or suexec.
Thanks and Regards,
vishal.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Run a shell script from a servlet?