This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Page to call Linux Shell Script

 
Michael Lim
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic