Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Socket Permission in JavaPolicy file..

 
GS Chidam
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

My real problem is:

In my applet, i am using servlet - applet communication to get the data from server. In the applet i am showing some data.

When I am using http, i don't have any problem working fine, when i am using proxy connection with https i am getting problem.

The error is
Exception:java.security.AccessControlException: access denied (java.net.SocketPermission proxy:80 connect,resolve)

if i am changing my policy file adding this permission, it works fine. But i don't want to change in the policy file, is there any option to add the permission in the java class file itself instead of changing the policy file.

need help.

Thanks in advance

Chidam GS
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The other way around this is to sign the applet. That is described here: HowCanAnAppletReadFilesOnTheLocalFileSystem
[ March 08, 2007: Message edited by: Ulf Dittmer ]
 
GS Chidam
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Actually i don't want to create the sign applet, and also i don't want to manually change the policy file.

Is there any option to change the policy file using java code. Whenever the user open that applet page, i want to change policy using my code.

thanks in advance

regards
GS Chidam.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the applet code were able to change the local security settings, then the whole sandbox security would be worthless. It is impossible by design.

Those two methods are the only way to get around the problem you're facing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic