Java小程序不缓存 [英] Java Applet not caching

查看:161
本文介绍了Java小程序不缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Java小程序的问题我已经部署了拒绝在JVM的粘性缓存到缓存(或浏览器)。对于每一个用户加载页面此applet是,在JVM重新下载​​从导致长时间的延迟,服务器jar文件的时间有些道理的。

正在通过互联网访问包含applet的网页,所以根据的 我使用Sun公司的Java小程序文件的<小程序> 标签,而不是<对象> <嵌入方式> 标签

任何帮助调试或识别问题会大大AP preciated。

下面是我使用的是全小程序标记:

 <小程序ALT =扫描小程序加载失败档案=scanning.jar
        code =scanning.scanlet.classcodeBase类=/ JAVA /codeTYPE =应用程序/ JAVA
        高度=30MAYSCRIPT =真NAME =scanletWIDTH =200>
    < PARAM NAME =域值=192.168.12.23/>
    < PARAM NAME =publishNameVALUE =scan_attachment/>
    < PARAM NAME =publishURLVALUE =htt​​p://192.168.12.23/draft/update/52/>
    < PARAM NAME =curURLVALUE =htt​​p://192.168.12.23/draft/edit/52/>您的浏览器无法处理在Java和放大器; LT; APPLET&放大器; GT;标签需要显示该applet
< BR />
一个解决办法是下载一个更好的网页浏览器一样
< A HREF =htt​​p://www.mozilla.com/firefox> Mozilla的Firefox< / A>< /小程序>


解决方案

我有同样的问题,发现需要应用服务器端的把戏。如此看来,如果他们的MIME类型是不正确的罐子不缓存。使用应用程序/ Java的存档MIME类型,请检查您的服务器的回复。

我发现的另一个问题是与特定罐子。我的归档参数已上市多罐,但只有少数被缓存。我发现,高达一个特定的地方缓存的所有罐子,所有剩余的罐子并没有缓存的。
当装载的小程序,我$ P $在其Java控制台pssed5,刚刚过去的缓存罐子后发现,这条消息:缓存:进入签约罐子从失踪。我仍然不知道什么是错的这个文件,但是我感动的是罐子在归档参数列表的末尾。此固定的问题。

I'm having a problem with a Java applet I've deployed that is refusing to be cached in the jvm's "sticky" cache (or by the browser). For some reason every time a user loads the page this applet is on, the jvm re-downloads the jar file from the server which causes a long delay.

The webpage containing the applet is being accessed via the internet, so according to Sun's Java applet documentation I'm using an <applet> tag rather than an <object> or <embed> tag.

Any help debugging or identifying the problem would be much appreciated.

Below is the full applet tag I'm using:

<applet alt="Scanning Applet failed to load" archive="scanning.jar"
        code="scanning.scanlet.class" codebase="/java/" codetype="application/java"
        height="30" mayscript="True" name="scanlet" width="200">
    <param name="domain" value="192.168.12.23" />
    <param name="publishName" value="scan_attachment" />
    <param name="publishURL" value="http://192.168.12.23/draft/update/52" />
    <param name="curURL" value="http://192.168.12.23/draft/edit/52" />

Your browser is unable to process the Java &lt;APPLET&gt; tag needed to display this applet
<br />
One solution would be to download a better web browser like
<a href="http://www.mozilla.com/firefox">Mozilla's Firefox</a>

</applet>

解决方案

I had the very same problem and found a trick that need to be applied server side. It seems that jars aren't cached if their mime type is incorrect. Please check your server reply using the application/java-archive mime type.

Another problem I found is related to a specific jar. My archive parameter was listing many jars, but only a few were cached. I found that all jars upto a specific one where cached, all remaining jars weren't cached at all. While loading applet, I pressed "5" in its java console and found this message just after the last cached jar: cache: signed entry missing from jar . I still don't know what is wrong with this file, but I moved that jar at the end of the archive parameter list. This "fixed" the problem.

这篇关于Java小程序不缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆