|
Hi,
I am new to AJAX. This is my first project with AJAX and I am getting error "system error -1072896748" when I try to get the xmlhttp.responsetext
my html page:
<body onLoad="sendReq(url, stateChanged);">
<div id="txtOut">This will be replaced by xmlhttp.responsetext </div>
my .js:
var xmlHttp = createRequestObject();
function sendReq(url, handlerFunction) {
xmlHttp.onreadystatechange = handlerFunction;
xmlHttp.open('get', url, true);
xmlHttp.send(null);
}
function stateChanged() {
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
document.getElementById("txtOut").innerHTML = xmlHttp.responseText ;
}
}
the url in the xmlHttp.open is a call to a jsp page which is calling a method ProcessRequest in java to process the request.
The method in java to process the request is using the ServletOutputStream, something like this:
ServletOutputStream outputStream = response.getOutputStream();
lBytesRead = inputStream.read(bBuffer);
outputStream.write(bBuffer, 0, lBytesRead);
outputStream.flush();
outputStream.close();
PLEASE HELP
thanks,
Thuy
|