My main web application is on apache, but sometimes I need to import some pages/data from tomcat server running on same machine. Now Ajax doesn’t allow me to request data from tomcat due to “Single Origin Policy”.
So how can I implement the import of data from tomcat? One solution could be to use iframes. However someone suggested using relative urls. How do I implement that?
Use the Apache Tomcat Connector (mod_jk). This is used to tell Apache that certain resources will be served by Tomcat (much like mod_php/ mod_perl, etc.). Then your requests go to the same server and you get the added bonus of being able to apply all Apache’s stuff to your servlets.