title: Ajax request not passed to controller
body: <p>I send an AJAX request to my <strong>controller</strong>. This development done in JSP and Spring environment. <strong>SimpleFormController</strong> is overridden by the <strong>controller</strong> I'm using. </p>
  
  <p>Using JavaScript I create the object and send the request. this request is not getting passed to controller.</p>
  
  <p>JavaScript code which send the request.</p>
  
  <pre><code>function getStates(){
      var httpRequest;
      var country = document.getElementById('countryName');
      alert(country);
      var url = '/developer/register.htm';
  
      url = url + (url.match(new RegExp('\\?')) ? '&amp;isAjax=true' : '?isAjax=true');
  
       if (window.ActiveXObject)
       {
           httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
       }
       else if (window.XMLHttpRequest)
       {
           httpRequest = new XMLHttpRequest();
       }
  
       httpRequest.open("GET", url, true);
       httpRequest.onreadystatechange = function() {processRequest(); };
       httpRequest.send(null);
  }
  
  function processRequest() {
      if(httpRequest.readyState == 4){
          alert("inside ready state");
          var response = http.responseText;
          document.getElementById('states').innerHTML = response;
      }
  }
  </code></pre>
  
  <p>Variable <code>url</code> is given in the way how I have mentioned in <strong>dispatcher servlet</strong>.</p>
  
  <p>The browser shows an <strong>error</strong> in <strong>processRequest()</strong> function telling that httpRequest is not defined. but, I don't get this error in the previous lines. I use this object in <strong>getStates()</strong> function.</p>