简体   繁体   English

使用浏览器启动小程序时出现问题

[英]Problem launching an applet with a browser

I designed an Client/Server application allowing to download PDF files from the server. 我设计了一个客户端/服务器应用程序,允许从服务器下载PDF文件。 I tried to convert my application to an Applet. 我试图将我的应用程序转换为Applet。 Everything works when I launch the applet with the Eclipse Applet viewer. 当我使用Eclipse Applet查看器启动applet时,一切正常。

However, when I try to launch my application with a browser(any browser), the browser sends to the server the following http request and waits for an answer : 但是,当我尝试使用浏览器(任何浏览器)启动我的应用程序时,浏览器将以下http请求发送到服务器并等待答案:

GET /crossdomain.xml HTTP/1.1
User-Agent: Mozilla/4.0 (Windows 7 6.1) Java/1.6.0_24
Host: 127.0.0.1
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Cookie: __utmz=96992031.1301339630.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);                  __utma=96992031.1102947305.1301339630.1301339630.1301339630.1

What am I supposed to do? 我应该做些什么?

Any help is appreciated 任何帮助表示赞赏

Unsigned applets normally are only allowed to access the same server they were loaded from. 通常,未签名的applet只允许访问从中加载它们的服务器。 Your applet tried to access another server. 您的小程序尝试访问另一台服务器。 In earlier Java versions, this was simply forbidden, but with newer versions, the VM asks the target's server if this should be allowed (by looking in its crossdomain.xml file). 在较早的Java版本中,这是完全禁止的,但是在较新的Java版本中,VM会询问目标服务器是否应允许这样做(通过查看其crossdomain.xml文件)。

Read the Cross-domain policy file specification for how such a file should look like, or arrange your applet to be loaded from the same server it wants to access later. 阅读跨域策略文件规范,以了解这种文件的外观,或安排将applet从以后要访问的同一服务器上加载。

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

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