开发者

Access denied | uncaught exception in FF 2.0 | servlet call from another host

开发者 https://www.devze.com 2022-12-09 03:19 出处:网络
Seems like got stuck in the cross domain issue. Just trying to get the XML response from the servlet call through POST

Seems like got stuck in the cross domain issue.

Just trying to get the XML response from the servlet call through POST method:

$.ajax({ type: "POST", url: "http://10.210.221.43:9081/shopsfinder/servlet/ ShopsFinderStoreServlet" //THIS DOESN'T //url: "../ShopsFinderStoreServlet" //IT WORKS ..................

It works fine when we place the servlet at the same location where our application server is, with the relative path.

BUT we have to put the servlet somewhere else means [at some other location], due to some limitatio开发者_运维技巧ns.

Then it doesn't hit the servlet and we don't give any response back to the browser and it goes in error function as given:

                    error: function(XMLHttpRequest, textStatus, errorThrown) {
                            alert("errror XMLHttpRequest: " + XMLHttpRequest.responseXML + "textStatus: " + textStatus + "  errorThrown: " +errorThrown);
                            }

Which gives all the values NULL and get the exception in FF.

Do we have any work around to overcome this issue?

Many thanks Mohammed Arif


Cross Domain Access are initially disabled by most browsers for security reasons. To overcome this issue you must enable Cross Domain Access or perhaps implements Ajax Proxies.


Because of some reason, we couldn't use proxy.

But we have overcome the issue, we have used Open Hub AJAX API which solved cross domain problem, now everything has been working fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号