I want to create a simple AJAX call, based on How to use Servlets and Ajax? answer.
The servlet processes the request (it can print on console in the doGet() function), but nothing happens on the client side.
Chrome error message is:
XMLHttpRequest cannot load http://localhost:8080/package/servlet. Origin null is not allowed by Access-Control-Allow-Origin.
Thanks!
That is definitely a problem. You should request the HTML over HTTP instead. Your target endusers also won’t run HTML from the local disk file system, right?
Open http://localhost:8080/package/filename.html in your browser.