使用旧小程序中的deployjava.js 添加参数
我正在使用deployjava.js来部署这个小程序
<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>
小程序的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>
,显然这是不正确的。让它发挥作用的正确方法是什么?
自然语言处理
<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>
I am using deployjava.js to deploy this 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>
The API for the applet says to pass these params (specifically the canvas)
I tried this
<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>
And clearly that is not correct. What is the correct way to get this working?
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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果将来有人偶然发现这一点,当您调用该属性并为其提供 .jar 文件的位置时,不需要同时引用 jnlp。
In case someone stumbles upon this in the future, when you call the attribute and give it the location of your .jar file, it isn't needed to also reference the jnlp.