File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes client server programming Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "client server programming" Watch "client server programming" New topic

client server programming

Shreegowri Bhojanna

Joined: Feb 13, 2014
Posts: 5
I have two shell script in client side, i want to send those two to server and server should run those scripts and it should send back the result back to client... I am new to this topic... Is there any way...

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41015
You could write a servlet that accepts the uploaded files, stores them in the file system, and executes them via Runtime.exec or ProcessBuilder. It could then read the results (either directly from the process output, or from a file created by the scripts), and then forwards to a JSP that display those results. All this assumes that the servlet (or rather, the servlet container) have the proper permissions to do all that.

As a general security precaution, I'd be very hesitant to let users upload and run arbitrary scripts, though. Your system administratir would probably agree to that.

Ping & DNS - my free Android networking tools app
I agree. Here's the link:
subject: client server programming
Similar Threads
How to get current date based on time zone or locale, or user preference?
what streams to use for inputing and outputing an character array over a socket
Server side include Vs. Scripting Language
Telnet client from webapp [was: Help needed in jsp and beans]
switching the connection between two servers