Executing shell command from JSP file with command line arg from URL
I have a home automation application that runs on Tomcat, and I am looking to extend the capabilities... Problem is I am not a programmer...
I am looking for a JSP script that will run a command line and use 2 values from the URL to define the action. Example: The X10 SDK provides an executable (ahp.exe) that takes 2 command line options: device and status. The executable then sends the command to the device attached via USB. If I were trying to turn the device A10 to on, the command I would run at the command line would be "ahp.exe A10 ON". So - long story short, I am looking to be able to go to a URL like this: localhost:8080/my.jsp?device=A10&status=ON and have that JSP run the command in the background. I don't care about getting feedback, I assume Tomcat will complain in its own logs if there is an issue. Any help is appreciated - I have searched here and elsewhere, I suppose I am not looking up the right search strings.... Thanks! Bob |
Shame your not running Linux and Bash... can do the very thing your asking for with cgi-scripts - I used it to stop - start and restart JBoss for humans.
Seems you are on Windows (ahp.exe) no clue if the same is possible, never tried. http://www.linuxaria.com/article/bash-cgi?lang=en |
Quote:
Thanks! Bob |
All times are GMT -5. The time now is 04:38 PM. |