• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

JSP Page to call Linux Shell Script

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Right! We're on it! Let's get to work tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic