我正在使用deployjava.js来部署此applet
<script src="http://java.com/js/deployJava.js"></script><script>
var attributes = {codebase: '/devel/app/webroot/jpainter/applet',code: 'Painter.class', archive:'painter.jar', width:640, height:480} ;
var parameters = {jnlp_href: 'plugin2.jnlp'} ;
deployJava.runApplet(attributes, parameters, '1.6');
</script>
applet的API说要传递这些参数(特别是画布)
我试过这个
<script src="http://java.com/js/deployJava.js"></script>
<script>
var attributes = {codebase: '/devel/app/webroot/jpainter/applet',code: 'Painter.class', archive:'painter.jar', width:640, height:480} ;
var parameters = {jnlp_href: 'plugin2.jnlp', gui:'canvas.gui'} ;
deployJava.runApplet(attributes, parameters, '1.6');
</script>
显然这是不正确的。让这个工作的正确方法是什么?
JNLP
<resources>
<j2se version="1.4+"/>
<jar href="/devel/app/webroot/jpainter/applet/painter.jar"/>
</resources>
<applet-desc name="painter" main-class="Painter" width="640" height="480">
<param name="plugin2" value="true" />
</applet-desc>
</jnlp>
答案 0 :(得分:0)
如果将来有人偶然发现这种情况,当您调用该属性并为其指定.jar文件的位置时,也不需要引用jnlp。
<script type="text/javascript" src="https://www.java.com/js/deployJava.js"></script>
<script type="text/javascript">
var attributes = {name: 'painter', codebase: BASE_DIR + '/app/webroot/jpainter/applet',code: 'Painter.class', archive:'painter.jar', width:742, height:262} ;
var parameters = {gui:'canvas.gui', image_width:'740', image_height:'260', stroke:'solid3'};
var version = '1.6' ;
deployJava.runApplet(attributes, parameters, version);
</script>