• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP AJAX postback  RSS feed

Ranadhir Nag
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a javascript function for a POST request from XMLHttprequest object:
function lookup(field) {
if (window.XMLHttpRequest) { req = new XMLHttpRequest(); }
else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); }
var formdata = "ajaxreq=true";
" var formAction = window.document.forms[0].action;\n" +
"req.open(\"POST\",formAction,true);\n" +
"req.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\n" +
req.onreadystatechange = processXMLResponse;

This request is generated from within the directoryBrowser.jsp itself.
This request is not being recognized as a post-back by the JSF framework ,successful as it is not causing the decode method of the component to be executed.

What is wrong?
When i print out the responseText of the request object from the callback function, i get teh html of the page printed out.The responseXML is null.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!