I am Calling a jsp(which is in another tomcat) using ajax function.But i am getting any response back ..I placed my code below
This is my ajax function(In tomcatA)
function connect(){
try{
// Firefox, Opera 8.0+, Safari
var xmlHttp=new XMLHttpRequest();
}catch (e){
// Internet Explorer
try {
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}catch (e) {
try {
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}catch (e) {
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function(){
alert(xmlHttp.status);
if(xmlHttp.readyState==4){
}
}
url="http://IP:PORT/List/Get.jsp";
xmlHttp.open("GET",url+"?sid="+Math.random(),true);
xmlHttp.send(null);
}
Below is my Get.jsp(In tomcatB)
<%@page import=" "%>
<%@page import=" "%>
<select>
<%Iterator it = HashMap.keySet().iterator();
while(it.hasNext()){
String key = (String)it.next();
String value = (String)HashMap.get(key);
%>
<option><%= key + " " + value %> </option>
<%}%>
</select>
But if i access the Get.jsp directly from browser its work fine.. i am getting the combo box with data(as i expected).Please help me on this.. i swear URL and all right
Ajax is used between two different tomcats. if we done the below setting
IE–>Tools–>Internet Options–>security–>custom level–>miscellaneous–>Access data source Accross domains–>Enable
this setting should be done in requesting IE side