Hi, I made applet but the error occur when I use this in netscape 7.0.
(OS is MS windows)
the situation is that.
0. this applet is signed.
1.
the applet has a public method (name is Upload) that show FileDialog.
When I call this method with java-script,
the browser is holding on so the status to be 'status is not
response'.
2.
the other method (name is Download) parses xml data with SAXParser.
but if I called this public method, it throw exception like this.
(in xml parsing)
Exception : java.security.AccessControlException: access
denied(java.util.PropertyPermission entityExpansionLimit read)
(in file save)
Exception : java.security.AccessControlException: access
denied(java.io.FilePermission E:\Inetput\test.html write)
but the interesing thing is that when I called these method with
applet's button, they works very well.
and in IE 5.x, both java-script and applet's button success to call
method.
the code is this.
/////////////////////////////////////////////////////////////////////
//
Applet code...
public class tester extends java.applet.Applet implements
ActionListener{
FileDialog dlgFileOpen = null;
public static Frame getTopLevelParent(Component component) {
Component c = component;
while (c.getParent() != null) {
c = c.getParent();
}
if (c instanceof Frame) return (Frame)c;
else return null;
}
public void init() {
setLayout(new FlowLayout());
btnUpload = new Button("Upload");
btnDownload = new Button("Download");
add(btnUpload);
add(btnDownload);
btnUpload.addActionListener(this);
btnDownload.addActionListener(this);
}
public void Upload(String URL) { // java-script is failed,
actionPerformed is OK.
showStatus("Uploading");
try{
dlgFileOpen.show(); // can't process the next line...
} catch (Exception e) {
showStatus("error " + e);
}
}
public void actionPerformed(ActionEvent e) {
Object obj = e.getSource();
if(obj == btnUpload){
Upload(UploadUrl); // it's OK
} else if(obj == btnDownload){
Download(DownloadUrl);
}
}
}
//////////////////////////////////////////////////////////////////////////
// HTML code
<BODY>
<APPLET name="Fav" code="tester.class" width=350 height=200></APPLET>
<button onclick="document.Fav.Upload('test')">Upload</button>
</BODY>
To sum up,
Netscape 7.0 ----> document.Fav.Upload('test') does not works.
applet's button input works.
IE 5.x ----> document.Fav.Upload('test') works.
applet's button input works.
So, what is the matter?
if you can any advice to me, please help me.
Thanks in advance.
Roedy Green - 22 Aug 2003 23:58 GMT
>Hi, I made applet but the error occur when I use this in netscape 7.0.
>(OS is MS windows)
First track down which policy files are being used in both cases.
It looks as if you want to add a permission to the netscape one.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.