On 1/14/2011 1:32 AM, Spendius wrote:
Is there an easy way to perform these 2 steps (using Struts maybe) ?
No not Struts, just use the standard API. Check out HttpURLConnection:
http://download.oracle.com/javase/6/docs/api/java/net/HttpURLConnecti...
I haven't actually done this myself, but I've seen others talk about it
so I'm sure it's feasible. You'll probably need a few more classes
besides HttpURLConnection.
I'd really like to be able to type something like:
C:\temp> java -cp %CLASSPATH% SwitchOffMyNAS
in a DOS window and have my external device to shut down...
Also feasible. Java SE installs a file association for Jar files by
default. On my own system, I can type<someJar.jar> into the Search box
on the Start Menu (bottom left on the windows task bar) and the Jar will
execute.
You have to have the Jar file on the PATH (not class path). I just set
up a single personal directory "C:\usr\bin" on my windows drive and copy
Jars I want to execute into there.