Can't i have this code in a applet?
Code:public class runMe extends Applet
{
public void init()
{
try
{
Runtime.getRuntime().exec("myProcedures.bat");
}
catch(Exception _ex)
{
System.out.println("ERROR!!!");
}
}
}
Printable View
Can't i have this code in a applet?
Code:public class runMe extends Applet
{
public void init()
{
try
{
Runtime.getRuntime().exec("myProcedures.bat");
}
catch(Exception _ex)
{
System.out.println("ERROR!!!");
}
}
}
No. Security limitations.
Well, you can have the code, but it will throw an exception.
Hummmm i suposed it was cause of that...
I'v tryed to bypass that but it's not possible, i need to find an other solution for this
I had made once a bypass to the security and i made a applet that
could read some txt files on the server.
Maybe i can fin a solution for this too :)
Thanks for your time:thumb:
That's not bypassing. Establish network connections to the originating server is explicitely allowed.
:( but isn't really any way to exec something in the server remotely using java?
I don't want to install anything on my server, i just have a apache
runing on it.
what i'd like to do is to shutdown or reboot the server remotely,
without going home all times i need to restart it.
Well, you could have a privileged CGI script there that shuts down the server. You need to protect this quite well, though.
Some problems arise:
1) It must be a different server process than your main web server for security reasons: the server that hosts the CGI must stay root (unlike the normal, which binds to port 80 and then gives up root privileges), which is dangerous.
2) It must have its own configuration (obviously).
A better solution than writing an applet like this would be to use an existing remote administration package. There's one written in PHP at sourceforge.net, can't remember its name though. WebMin, I think.
ahh...ok then! the php file should help a lot...as i have a apache server runing...
Run as root is out of chance...no way i will do that.
Thanks so much for your nice help!:afrog: