This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Ajax cross domain problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Ajax cross domain problem" Watch "Ajax cross domain problem" New topic

Ajax cross domain problem

Li Xin
Ranch Hand

Joined: Feb 06, 2004
Posts: 37
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

Joined: Nov 08, 2001
Posts: 15376
Machine does not matter. The domain has to be the same.

Wyatt Matthews

Joined: Aug 31, 2006
Posts: 3
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.
jQuery in Action, 2nd edition
subject: Ajax cross domain problem
Similar Threads
How do I let my IIS and Tomcat using the same port?
how to display jsp page in IIS directly
default index.jsp in IIS6 shows source code
When using IIS & Tomcat, should I install ssl on IIS or tomcat?
Invoking Servlet Tomcat 5.5.4