java.sun.com 的tutorial 上有用apple 在本地写一个文件的例子:
http://java.sun.com/docs/books/tutorial/security1.2/tour1/
但只能用appletviewer 可以看:
appletviewer http://java.sun.com/docs/books/tutorial/security1.2/tour1/example-1dot2/writefile.html
又在[阿费]的帮助下找到可以用ie or nescape 查看你的applet 的例子:
http://www.intelligentsearch.org/namesearch_from_java.htm#_toc490550108
大致过程如下::
服务器端:
1。 compile the java classes --写applet并编译。
javac *.class
2. place the class files in a jar file --打包:
jar cvf yourjarname.jar yourdir/*.class
1). create a keystore and keys for signing the jar file
keytool –genkey –keystore ist.keystore –alias ist
2). sign the jar file --对jar 签名
jarsigner –keystore ist.keystore ist.jar ist
3). create the public key certificate --创建公钥
keytool –export –keystore ist.keystore –alias ist –file istpubkey.cert
客户端:
1。import the public key certificate --导入公钥
keytool –import –alias ist –file istpubkey.cert –keystore client.store
2。modifing a policy file --修改 policy文件
3。 run the applet --运行applet
!!! 这还只能用applet viewer 查看你的applet
用ie访问:
first, the <applet> tag will not be able to activate the java plug-in for use in ie. this tag should be substituted by the <object> tag
---由于ie 的java plug-in 不能被<applet>标签激活。你还要将他换成<object>标签。
these changes to the html file can also be done with the help of htmlconverter. you can go to download this software from http://java.sun.com/products/plugin/index.html.
---- 这样你还要去下一个htmlconverter
---- 将经过转换的html 和 class 文件copy 到你的服务器上。
-- 好了。终于可以享受一下成果了。
用ie 访问:http://yourserver: youreport/writefile.html
还不行??
--ie 还要下载plug-in 才能执行,
在1小时加26分46秒后:
kao ,终于在本地写了一个文件。
////////////////////////////////////////////
感谢:
【wmlf】 和 【阿费】提供的资料和帮助
////////////////////////////////////////////
我的问题:
1。如果我写的applet,放在网上,
他还必需下载或自己修改java.security and java.policy
然后放到 :
<java home>/lib/security 下(如果安装了jdk)
<use dir>/.java.policy (没有 jdk)
那不是太麻烦了????
谁还会用你的applet ????
2。是不是我对applet 认证理解不对,,本来applet的认证没这样繁??
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!


