Je reçois le java.lang.SecurityException: Permission denied: file:////Videos/public/scripts/screenshot.jar
lorsque j'essaie d'utiliser une applet.Obtenir une SecurityException: autorisation refusée dans java
Voici le code de l'applet:
<applet code="Screenshot" archive="file:////Videos/public/scripts/screenshot.jar" width="100px" height="100px">
</applet>
Comment puis-je résoudre ce problème et quel est le problème même moyen?
EDIT:
D'après ce que je vois que je dois signer l'applet. Quelqu'un pourrait-il expliquer comment et pourquoi cela est fait? Le site fourni fait un mauvais travail en l'expliquant car il ne tient même pas compte du fait que je l'intègre dans mon site et je veux que chaque client l'utilise et ne doive rien signer. Cliquez simplement sur courir.
EDIT2:
Le code de l'application elle-même:
/*
By Bavo Bruylandt (Http://www.realapplets.com")
*/
// and now The inevidable "Hello World" example :)
// tell the compiler where to find the methods you will use.
// required when you create an applet
import java.applet.*;
// required to paint on screen
import java.awt.*;
// the start of an applet - HelloWorld will be the executable class
// Extends applet means that you will build the code on the standard Applet class
public class Screenshot extends Applet
{
// The method that will be automatically called when the applet is started
public void init()
{
// It is required but does not need anything.
}
// This method gets called when the applet is terminated
// That's when the user goes to another page or exits the browser.
public void stop()
{
// no actions needed here now.
}
// The standard method that you have to use to paint things on screen
// This overrides the empty Applet method, you can't called it "display" for example.
public void paint(Graphics g)
{
//method to draw text on screen
// String first, then x and y coordinate.
g.drawString("Hey hey hey",20,20);
g.drawString("Hellooow World",20,40);
}
}
Il y a de bonnes chances que vous deviez simplement [signer l'applet] (http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed .html). –
Dois-je le faire pour chaque applet? Et sont ces outils déjà installés (comme keytool) – Vadiklk
Un peu plus à lire: [Ce que les Applets peuvent et ne peuvent pas faire] (http://docs.oracle.com/javase/tutorial/deployment/applet/security.html) –