Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Re: problem: se...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 15 Topic 16050 of 16477
Post > Topic >>

Re: problem: security using IDE's appletviewer

by Mark Space <markspace@[EMAIL PROTECTED] > May 5, 2008 at 09:26 AM

bH wrote:

> That said, I have looked at Canadian Mind Products
>  > P words > policy
> 
> The instructions  say to use:
> 
> grant {
> permission java.security.AllPermission;
> };
> 
> I have added these lines above but now there is an error at
>  compile time for this applet:
>  <identifier> expected (obviously after the word "grant")

Read the rest of Roedy's page.  Especially the part where he tells you 
that the policy file is outside of your program.

<quote>
Where are the policy files?
Exactly how many policy files you have and where they are is controlled 
by settings in the C:\Program 
Files\java\jre1.6.0_06\lib\security\java.security or C:\Program 
Files\Java Web Start\java.security. The Opera browser has its own policy 
file at C:\Program Files\Opera\cl*****\Opera.policy.

The default is to have:

    1. a single system-wide policy file J:\Program 
Files\java\jdk1.6.0_06\jre\lib\security\java.policy in the 
java.home\lib\security directory.
    2. a user-specific policy file user.home/.java.policy, e.g. 
"C:\Do***ents and Settings\%username%\.java.policy". In Vista, look in 
"C:\Users\%username%\.java.policy".
</quote>


>       //ioStream = getImage(getCodeBase(),
>       // "image/JBsm.JPG" );
>       //above line works with both the IE browser page
>       // and applet viewer
>       ioStream = getImage(getCodeBase(),
> "file:/C:/JBsm.JPG" );
>       //above line works with the Browser page but fails
>       //using the applet viewer

Realistically, this isn't going to work.  No one but you is going to 
edit their own policy files.  Make this image into a resource, and use 
getResourceAsStream().  That's the correct way to package extra files 
with an applet.
 




 15 Posts in Topic:
problem: security using IDE's appletviewer
bH <bherbst65@[EMAIL P  2008-05-05 06:49:23 
Re: problem: security using IDE's appletviewer
Mark Space <markspace@  2008-05-05 09:26:16 
Re: problem: security using IDE's appletviewer
Knute Johnson <nospam@  2008-05-05 15:02:05 
Re: problem: security using IDE's appletviewer
Roedy Green <see_websi  2008-05-06 05:19:44 
Re: problem: security using IDE's appletviewer
bH <bherbst65@[EMAIL P  2008-05-06 21:14:28 
Re: problem: security using IDE's appletviewer
Knute Johnson <nospam@  2008-05-06 22:41:20 
Re: problem: security using IDE's appletviewer
bH <bherbst65@[EMAIL P  2008-05-06 23:15:05 
Re: problem: security using IDE's appletviewer
Knute Johnson <nospam@  2008-05-07 09:26:35 
Re: problem: security using IDE's appletviewer
bH <bherbst65@[EMAIL P  2008-05-07 12:52:20 
Re: problem: security using IDE's appletviewer
Knute Johnson <nospam@  2008-05-07 13:09:04 
Re: problem: security using IDE's appletviewer
bH <bherbst65@[EMAIL P  2008-05-07 19:12:12 
Re: problem: security using IDE's appletviewer
Knute Johnson <nospam@  2008-05-07 22:16:30 
Re: problem: security using IDE's appletviewer
bH <bherbst65@[EMAIL P  2008-05-07 23:20:54 
Re: problem: security using IDE's appletviewer
Lew <lew@[EMAIL PROTEC  2008-05-08 06:47:22 
Re: problem: security using IDE's appletviewer
bH <bherbst65@[EMAIL P  2008-05-08 04:29:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 12:31:13 CDT 2008.