0

Is it possible to open terminal of the client machine for a java based web application.

I know, that I can use

Runtime.getRuntime().exec("<command to execute>");

The above code will execute the application at the server side. Is there a way to open the terminal window of client machine. I can get the OS details from "User-Agent" request header. But I am not sure if there is any non applet way of invoking client terminal.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
user2686860
  • 107
  • 4
  • 14
  • 3
    It's not possible. Imagine how bad of a security flaw it would be to allow a server command line access of a client. – FThompson Sep 08 '14 at 21:24
  • What problem are you trying to solve? What are you actually trying to accomplish? (and, by the way, you can't rely on the User-Agent string being true) – Stephen P Sep 08 '14 at 21:44

1 Answers1

1

The only non-applet way would be to have the user install an application beforehand. Your webpage could then trigger it via a custom protocol.

For example, if your custom protocol was "myapp", clicking a link with this URL...

myapp://runexec

would trigger your app and pass it the URL "runexec" as a message. Depending on the message received you could do various things.

Community
  • 1
  • 1
martinez314
  • 12,162
  • 5
  • 36
  • 63