File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSP Page to call Linux Shell Script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Page to call Linux Shell Script" Watch "JSP Page to call Linux Shell Script" New topic
Author

JSP Page to call Linux Shell Script

Michael Lim
Greenhorn

Joined: Oct 07, 2002
Posts: 1
What I need to do is to use my JSP page to call a Linux Shell Script which will, in turn, upload files from a local computer to a Linux server. How do I come about this?
Remesh Govind
Greenhorn

Joined: Aug 28, 2002
Posts: 8
Runtime rt = Runtime.getRuntime();
if (rt!= null)
rt.exec("/usr/bin/sh path/command.sh') ;
// the command

...
I hope this will hep u .
Remesh govind


Remesh G
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Before we go too far on this I would like to make sure that we both understand what you need and the way JSP works.
JSP code is run on the server, and typically used to dynamically generate HTML for web pages. The JSP code is run before the page is sent to the client browser, and so has no way it can read or write anything on the client system.
Now, have I misunderstood your question? Is your JSP server actually running on what you call the "local computer", and you need to know how to build an HTTP request containing a local file to send to yet another server ?


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Page to call Linux Shell Script
 
Similar Threads
Calling Linux shell in JSP
call java program from script?
Calling shell script
How to get Size of directory/folder in linux?
Get the UNIX process ID of the java program