未搜索 Applet jar 中的文件

发布于 2024-10-07 22:54:28 字数 913 浏览 1 评论 0原文

出于示例目的,假设我在网站上有一系列位置,并且 url 的格式为 /location/#/,其中 # 是我要查看的位置的 ID。由于我将 Django 与 Apache 结合使用,因此所有静态内容都位于 /media 中。每个位置页面都尝试加载一个允许文件上传的 Java 小程序。

<applet 
  codebase="/media/java/"
  code="com.elementit.JavaPowUpload.Manager"
  archive="JavaPowUpload.jar, commons-logging-1.1.jar, commons-httpclient-3.1-rc1.jar, commons-codec-1.3.jar"
  width="200"
  height="100"
  name="java-uploader"
  id="id-java-uploader"
  mayscript="true"
  alt="JavaPowUpload by www.element-it.com"></applet> 

所有列出的 jar 文件都位于 /media/java/ 中,并由 Web 服务器找到。小程序似乎可以毫无问题地加载到页面上,但是当查看页面加载期间的网络流量时,我发现存在几个错误。基本上,小程序似乎正在寻找 jar 内的文件,例如 com.elementit.JavaPowUpload.Messages_en.class,但正在向 Web 服务器请求它们,这相当于请求 /media/java/com/elementit/JavaPowUpload/ Messages_en.class,当然不存在。请注意,如果我摆脱代码库并给出每个 jar 的完整路径,我仍然遇到类似的问题,其中请求是 /location/#/com/elementit/JavaPowUpload/Messages_en.class。如何设置以便搜索 jar 文件而不是文件系统?

For example purposes, let's say I have a series of Locations on a website and the urls are of the form /location/#/ where # is the id of the location I want to view. Since I'm using Django with Apache, all of my static content is in /media. Each Location page is trying to load a Java applet that allows for file uploads.

<applet 
  codebase="/media/java/"
  code="com.elementit.JavaPowUpload.Manager"
  archive="JavaPowUpload.jar, commons-logging-1.1.jar, commons-httpclient-3.1-rc1.jar, commons-codec-1.3.jar"
  width="200"
  height="100"
  name="java-uploader"
  id="id-java-uploader"
  mayscript="true"
  alt="JavaPowUpload by www.element-it.com"></applet> 

All of the listed jar files are in /media/java/ and are found by the web server. The applet appears to load on the page without a problem but when looking at the network traffic during page load I see there are several errors. Basically the applet seems to be looking for files that are within the jar, say com.elementit.JavaPowUpload.Messages_en.class, but is asking the web server for them, which amounts to requesting /media/java/com/elementit/JavaPowUpload/Messages_en.class, which of course does not exist. Note that if I get rid of codebase and give the full path to each jar, I still have a similar problem where the request is then /location/#/com/elementit/JavaPowUpload/Messages_en.class. How do I set things up so that the jar file is searched rather than the filesystem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

人心善变 2024-10-14 22:54:28

请参阅 codebase_lookup 小程序属性。

See the codebase_lookup applet attribute.

月寒剑心 2024-10-14 22:54:28

尽管从不同服务器上的另一个页面获取此代码,但小程序的代码属性中似乎存在轻微错误。将 .class 添加到字符串解决了我的问题,但我不确定为什么它在其他主机和页面上没有它的情况下也能工作。

code="com.elementit.JavaPowUpload.Manager.class"

Despite taking this code from another page on a different server, it appears there is a slight error in the applet's code attribute. Adding .class to the string fixed my problem, but I'm unsure why it works without it on the other host and page.

code="com.elementit.JavaPowUpload.Manager.class"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文