简体   繁体   English

在Wordpress中嵌入java小程序

[英]Embedding a java applet in Wordpress

I have an applet that works alright on this page . 我有一个小程序在这个页面上正常工作。 It just references the .class file. 它只引用.class文件。 (unfortunately, I have lost the source, and the jar files.) (不幸的是,我丢失了源代码和jar文件。)

I want to reference it here , however it does not start. 我想在这里引用它,但它没有开始。 Probably because it cannot find the class file. 可能是因为它无法找到类文件。 the applet tag looks like this applet标签看起来像这样

<applet code="/applets/language/LanguageEngineApplet.class" width="1174" Height="402">
<embed code="/applets/language/LanguageEngineApplet.class" width="1174" height="402" type="application/x-java-applet" pluginspage="http://www.java.com/en/download/manual.jsp"/>
</applet>

I know the .class file is there, because I can link to it . 我知道.class文件在那里,因为我可以链接到它 So I'm stumped as to why this won't work. 所以我很难过为什么这不起作用。

I just put the applet in a page on it's own. 我只是把applet放在一个页面上。 The problem was not my Java version, it was the class name and the path and the package interacting somehow. 问题不是我的Java版本,它是类名,路径和包以某种方式交互。 I had to put it in a directory on its own, with the html file that referenced it in that directory. 我不得不将它放在一个目录中,并在该目录中引用它的html文件。

您可能希望查看Java Deployment Toolkit

If you do decide to embed a Java applet inside WordPress and not outside, I just released a new plugin that easily allows you to do that. 如果您决定在WordPress内部而不是在外部嵌入Java小程序,我只是发布了一个新的插件,可以轻松地让您这样做。 It uses shortcodes. 它使用短代码。

http://huyz.us/2011/the-easiest-way-to-embed-java-in-wordpress/ http://huyz.us/2011/the-easiest-way-to-embed-java-in-wordpress/

Hmmm, maybe I have to support uploading *.class files in your case. 嗯,也许我必须支持在你的情况下上传* .class文件。 Let me know, if you need that. 如果您需要,请告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM