running GWT application from remote machine

690 views Asked by At

I am developing some GWT application that some third-part will need to import into his own website.

The application that I am developing consist hosted on my machine which say at: http://myMachine.com/app/gwtApp.html

the application looks like:

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<link type="text/css" rel="stylesheet" href="http://myMachine.com:8888/app/gwtApp.css">
<title>gwtApp</title>
<script language="javascript" src="http://myMachine.com:8888/app/gwtApp/gwtApp.nocache.js"></script>
</head>
<body>
<div id="app" style="width:240px; height:190px;"></div>
</body>
</html>

NOTE: I've written some proxy servlet just to resolve the url againest my server, as you know the script tag above by default looks like: <script language="javascript" src="app/gwtApp/gwtApp.nocache.js"></script>, but my proxy converted it to : <script language="javascript" src="http://myMachine.com/app/gwtApp/gwtApp.nocache.js"></script>

The third-party uses some import mechanism (jstl import or whatever) just to import the above content into their web site (on completely different domain)

The problem is, they getting the Following JS error and nothing get rendered from the application:

Error: Permission denied for <http://172.16.0.87:8888> to get property Window.document from <http://thrid-party_domain.com>.
Source File: http://myMachine.com/app/gwtApp/37A4800286E685E7555FF8DCA66FC4F9.cache.html
Line: 1

Error: Permission denied for <http://myDomain:8888> to get property Window.gwtApp from <http://thrid-party_domain.com>.
Source File: http://myMachine.com/app/gwtApp/37A4800286E685E7555FF8DCA66FC4F9.cache.html
Line: 1463
1

There are 1 answers

1
Gursel Koca On

It looks like problem is related to same origin policy rule. Your css and javascript file has been published from different port : 8888 and 80. If you change the port of css file to 80, I believe you wont get the previous error..