本文介绍了Applet的罐子不被搜索的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如目的,假设我有一系列的网站上的位置和URL是形式/位置/#/#是我想要查看的位置的ID。由于我使用Django和Apache,我所有的静态内容是在/媒体。每个位置页试图加载Java小程序,它允许文件上传。

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> 

所有列出的jar文件都在/媒体/ JAVA /和web服务器被发现。小程序可以显示在页面上加载没有问题,但页面加载过程中的网络流量看,当我看到有几个错误。基本上小程序似乎要寻找的罐子内,说com.elementit.JavaPowUpload.Messages_en.class文件,但要求他们在Web服务器,这相当于请求/媒体/ JAVA / COM / elementit / JavaPowUpload / Messages_en.class,这当然不存在。需要注意的是,如果我摆脱codeBase类的,给的完整路径每个瓶子,我还是有类似的问题,其中请求,然后/location/#/com/elementit/JavaPowUpload/Messages_en.class。我该如何设定让JAR文件进行搜索,而不是文件系统?

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?

推荐答案

尽管服用code从另一个页面在不同的服务器上,似乎没有在applet的code属性略有误差。添加的.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"

这篇关于Applet的罐子不被搜索的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 09:38