我可以违反同源策略与Java小程序

问题描述:

我需要请求的东西,从其他域的信息。我知道JavaScript不能做到这一点,由于同源策略。我的另一种选择是,通过我的服务器进行代理请求。我不想请求从我的服务器的IP来也不想为我的服务器上创建额外负载,将preFER客户做到这一点。

I need to request things and get information from other domains. I know javascript can not do this due to the same origin policy. My other option is to make proxy requests through my server. I do not want the requests coming from my server's IP nor do I want to create additional load for my server and would prefer the client do it.

是否有可能使用Java applet来做到这一点?手动配置安全设置是不是一个问题。

Is it possible to use a Java applet to do this? Manually configuring security settings is not an issue.

Java小应用程序国家执行同源策略,几乎相同的方式为Flash。 Java将$为主的applet p $ pvent跨域调用如果目标服务器没有正确定义的可公开访问的crossdomain.xml。

Java applets do implement the same origin policy, much the same way as Flash. Java will prevent applet-based cross-origin calls if the target server does not have a properly defined publicly accessible crossdomain.xml.

一个简单的crossdomain.xml应该是这样的:

A simple crossdomain.xml would look like this:

<?xml version="1.0"?>
<cross-domain-policy>
  <allow-access-from domain="*" />
</cross-domain-policy>