I cannot get my JavaScript to successfully get a response from a JSP file.
The Javascript is
Code:
function Com_Mydomain_Test() {} ;
Com_Mydomain_Test.prototype = new ZmZimletBase() ;
Com_Mydomain_Test.prototype.constructor = Com_Mydomain_Test ;
Com_Mydomain_Test.prototype.init = function ()
{
var url = this.getResource('test.jsp') ;
var result = AjxRpc.invoke(null, url, null, null, true) ;
console.log(result) ;
} The JSP file is test.jsp:
Code:
<html>
<body>
<p>Hello.</p>
</body>
</html>
Using Firebug, I see that the response comes back
Code:
Date Mon, 16 Feb 2009 07:11:08 GMT
Content-Type text/html
Content-Length 0
I know that the JSP file is being accessed because if I misspell the JSP file (e.g., "testx.jsp") I get a 404 error. Looking at the variable
result using the Firebug console.log function, the value of its
success property is "true" but its
text property is the empty string.