0

So i made this simple JApplet and tried to open a socket and write to it, but i got an exception saying i don't have permission???

So then i looked at this: http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html

I've got the jar signed, and that's it. I don't get what to do after that????

And in the html file, what does

<param name=file value="/etc/inet/hosts">

do?

Are there any easier ways to sign japplets?

Let me ask this simply. How do i let my applet open a socket on lets say port 80 for google.com?

Mohammad Adib
  • 788
  • 6
  • 19
  • 39
  • Last time i checked, applets couldnt communicate with nothing but their base, meaning that you can communicate to the server that serve the applet and nothing else. – memo May 16 '12 at 00:45
  • 3
    @memo *"Last time i checked"* Check again. A trusted applet can communicate with any server that accepts connections. – Andrew Thompson May 16 '12 at 00:47
  • Will the applet be hosted on the same server it is attempting to connect to? – Andrew Thompson May 16 '12 at 00:47
  • 2
    BTW *"I don't get what to do after that????"* Only put question marks after questions (that is not a question), and then only one. – Andrew Thompson May 16 '12 at 00:48

1 Answers1

1
<param name=file value="/etc/inet/hosts">

This means that the name 'file' will have the value /etc/inet/hosts when queried by the applet. E.G.

// in the init() method ..
String fileValue = getParameter("file");
// fileValue now has the value '/etc/inet/hosts'
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433