Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ajax cross domain problem

 
Li Xin
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does any one know if Ajax request can be sent to another server in the same machine? I have Tomcat and IIS on the same pc, I tried to send Ajax request from JSP in Tomcat to a PHP in IIS, it seems does not work.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Machine does not matter. The domain has to be the same.

Eric
 
Wyatt Matthews
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could consider submitting a request to the IIS server from the Tomcat server, and then when the Tomcat server recieves the response from IIS, return the response from the Tomcat instance. In doing this, you are not asking the client/browser to make the cross domain connection (which is not possible for good reason), you are allowing the server to handle the cross domain issues for you.

Good luck.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic