aspose file tools*
The moose likes Applets and the fly likes Applet-Servlet , AttributeValues does not work in browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet-Servlet , AttributeValues does not work in browser" Watch "Applet-Servlet , AttributeValues does not work in browser" New topic
Author

Applet-Servlet , AttributeValues does not work in browser

Adeel Baloch
Greenhorn

Joined: Dec 14, 2011
Posts: 5
I am using Applet on Server, when I 'Run on server' it runs in a browser but statements and code after this statement don't work.

AttributeValues values = new AttributeValues();

I get error

access denied (java.lang.RuntimePermission accessClassInPackage.sun.font)

Nitin Surana
Ranch Hand

Joined: Jan 21, 2011
Posts: 129

To be run on a server, applet needs to be certified and that certificate needs to accepted by the client(browser) only then applet code will be permitted to execute.

More info here:

http://docs.oracle.com/javase/1.5.0/docs/guide/plugin/developer_guide/rsa_signing.html

http://www-personal.umich.edu/~lsiden/tutorials/signed-applet/signed-applet.html
Adeel Baloch
Greenhorn

Joined: Dec 14, 2011
Posts: 5
How to give full rights to the applet without signing. Because every little modification makes me to go through signing process.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19723
    
  20

You cannot. Applet security is simply so strict that, unless the applet is signed, you cannot access any resources other than those from the same server that the applet is running on. That means no access to the client's file system, no access to databases, no access to FTP servers, no access to other web servers, etc.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Adeel Baloch
Greenhorn

Joined: Dec 14, 2011
Posts: 5
Thanks!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18675
    
    8

I have an Ant task which does the applet signing process. It's run as part of the deployment process, so I don't have to spend my time typing obscure things at the command line.
Adeel Baloch
Greenhorn

Joined: Dec 14, 2011
Posts: 5
How can I use Ant task, i am using eclipse. can you explain or refer to a tutorial please.
I have index file with following tag

<applet code="Main/OMApplet.class" codebase="http://localhost:8080/OMWebConnection/Interface/" width="1600" height="800" ARCHIVE = "JAR/Jama-1.0.2.jar, JAR/jshapes.jar">

i would appreciate any help.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18675
    
    8

Tutorial? I just looked in the Ant documentation and found there was a "signjar" task. Of course, probably you haven't yet set up the things you need to sign the jar with, in which case you would have to do that first. If that's the case then your google keywords to find a tutorial are "jar signing tutorial".

The HTML element you use to specify the applet to the browser has nothing to do with any of that.

Edit: It just occurred to me that you question might also be "How do I run an Ant task in Eclipse?". You should really take more time to write a clear question rather than making us guess.
 
 
subject: Applet-Servlet , AttributeValues does not work in browser