473,396 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Running signed applets

Hey guys,

I wasn't completely sure if this would be a Java or JS topic, but I thought it had more to do with Ajax and whatnot. Anyway, I have an embedded and signed Java applet on my page like so:

<applet style="position:absolute;left:-1px" code="fileSaver.class" archive="SignedFileSaver.jar" width="1" height="1"></applet>

this applet's jar is signed, and it requests to get file access privilages. the actual function is called from an external javascript, like so:

document.applets[0].saveFile("classes.xml", data);

The source code for the file saver is as so:

import java.io.*;
import java.lang.*;

public class fileSaver extends java.applet.Applet {
public int saveFile(String filename, String data) {
try {
File file=new File(filename);
if (file.exists()) {
file.delete();
}

file.createNewFile();
System.out.println(data);
FileOutputStream fileio = new FileOutputStream(file);
fileio.write(data.getBytes());
fileio.close();
return 1;
} catch (Exception x) {
x.printStackTrace();
return 0;
}
}
}

The problem is, even after I accept the signiture, the browser won't allow the privilaged action of the applet. Is this maybe because I haven't signed the javascript file? If it is, how exactly do I sign it? I looked around, but nothing actually told me how to sign a js file. Thanks in advance.

jin
Apr 29 '07 #1
1 1489
acoder
16,027 Expert Mod 8TB
This probably is a Java problem. I'll move it to the Java forum.
May 1 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Justin | last post by:
Hi, We are researching options on which technologies to use for an advanced web application. We are planning on using DHTML as much as possible, but there are a few components that require more...
1
by: Vincent Montressor | last post by:
I'm playing around with writing my own panel applets, and I'm trying to figure out how to get my panel applets to be restored when I log in. As an experiment, I'm using the simple clock applet...
8
by: Andreas Røsdal | last post by:
Hi, Is there such a thing as python applets for web browsers? (eg. such as java applets?) I think that could be useful. Andreas R.
2
by: David Haga | last post by:
How can I query an applet from Javascript to determine when it is running? I need to start a second applet but only when I know the first applet is completely loaded, initialized and executing.
2
by: LC's No-Spam Newsreading account | last post by:
I asked a couple of days ago about the following arrangement (simplified). I made some progress using netscape.security.PrivilegeManager.enablePrivilege but still have to ask some further help. ...
12
by: Andrey | last post by:
Hi, I just wonder if anybody can help me with this: I need to give my javascript code some extended permissions for disk access on client's machine, and as i understand i need to sign this js....
2
by: praveen2gupta | last post by:
Hi I am working on the sound API . I wants to receive sound data from user. The documents are showing the need of the signed applets. I wants to know 1. why the need of signing arises. 2....
3
by: Robert Larsen | last post by:
Hi all I have a small problem with a signed applet. The applet works fine but some users wont click 'yes' to give the applet further privileges (that is ok too). If the user dont give the applet...
0
by: gotnspikes | last post by:
I am trying to create an applet using SitePad Pro. I am a college student and have a lab where I need to create applets. I did it in class just fine. I tried to run a "Hello World!" applet and it...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.