Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can a Runtime task be blocked in Applet?

 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
runTime.exec( someOSCommand )

It can execute any command on my Windows platform. It's said Applet running in sandbox, why there aren't some restricts on executing platform commands. Or I need to do some configuration to my IE?

Thanks.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Runtime.exec is prohibited by default. Unless the applet is signed, or the local security policy altered, it can't be used in an applet.
[ July 18, 2007: Message edited by: Ulf Dittmer ]
 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.

Then the applet I'm working on must be signed. But I don't see any warning message like starting WebStart. If I accept the signature, then I can run the application. So the user maybe confused when my applet invokes an OS command. Because he just thinks applet can't do this.

What I expect is maybe I still need to use Runtime.exec do something. But I don't want to let the user be frightened.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the thinking is that the user understands that if he accepts the certificate, then the applet is allowed to do (just about) anything it pleases. So he shouldn't accept a certificate from someone he doesn't trust not to format his hard drive, or email his personal files to random people.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!