• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems in creating policy

 
Sushma Rao
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I am a beginner in writing java applications. I wrote an applet which would create a file in my local memory. I also tried creating the policy file so that the applet would have access to the memory. But was unable to creat a policy. My doubts are as follows :
1) When creating a policy what address should the codebase contain ? I tried giving "C:\jdk1.2.1\bin" the directory where i have stored my applet...i get an error "java.net.MalfomedURLEXception:no protocol:C:\jdk1.2.1\bin"
I need to give access to a applet stored in my local memory. So i let this field be empty.....but it still didn't work.
2) Can i create a policy to give my applet access to my local datbase? If so how?
3) Where should i save my policy so that it gives access to my applet ? I tried storing it in the same directory as the applet.....but didn't work.
I would appreciate it if somebody could help me out.
Thanks,
Sushma
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) When creating a policy what address should the codebase contain ? I tried giving "C:\jdk1.2.1\bin" the directory where i
have stored my applet...i get an error "java.net.MalfomedURLEXception:no protocol:C:\jdk1.2.1\bin"

I would leave this blank.
Can i create a policy to give my applet access to my local datbase? If so how?
I know you can, but not sure how! Sorry.
Where should i save my policy so that it gives access to my applet ? I tried storing it in the same directory as the
applet.....but didn't work.

It depends on your OS. It (.java.policy) should be located
(generally) in your home dir.
On Unix its your home dir (do a cd <return> and you will be
in your home dir)
ON NT it is where your profile is stored. Generally
C:\winnt\profiles\username
On Win '98, I am not sure, I have to check this!
I will and let ou know.
regds.
- satya
 
Sushma Rao
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Madhav for your reply.
I tried running the applet again and it worked....i had missed running the applet with the policy file.
My other doubt is if i leave the codebase blank....what does it mean ? Am i giving access to all the applets ?
Well i'm working on the 'giving access to the database part' too. Do let me know if u can find out anything regarding this.
I want to know if there is any other way of doing the same...or is creating a policy file the only solution.
Thanks,
Sushma.
[This message has been edited by Sushma Rao (edited March 16, 2001).]
[This message has been edited by Sushma Rao (edited March 16, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic