I want to use html/js as the graphical interface for my Java apps, and for this I have a Jetty http server running on port 8040.
The client scripting is done on a Mongoose server on port 8080, using the jQuery AJAX get() method.
When performing the AJAX request, I get the
XMLHttpRequest cannot load http://localhost:8040/. Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.
I did a bit a google:ing and found that this is known as the Same origin policy, and if I understand this right, the script can not make a request to another port on the same adress? So how do I make this work, ie. run both the java server and the javascript client on the same machine?
Take a look at this wiki page:
http://wiki.eclipse.org/Jetty/Feature/Cross_Origin_Filter