title: How to get struts2 HttpServletReponse using xmlhttp request
body: <p>My struts.xml part</p>
  
  <pre><code>&lt;action name="viewall" class="com.abc.csm.actions.GetAllConfiguration"&gt;
           &lt;result name="success"&gt;/success.jsp&lt;/result&gt;
      &lt;/action&gt;
  </code></pre>
  
  <p>on Page load of Welcome.jsp i call a function <code>getXml()</code> which should receive xml as a response but instead i get <code>success.jsp</code> content</p>
  
  <pre><code>function getXml()
  {
   var url_action="/csm/viewall.action";
   var client; 
   var dataString;
  
   if (window.XMLHttpRequest){ 
       client=new XMLHttpRequest();
   } else {                    
       client=new ActiveXObject("Microsoft.XMLHTTP");
   }
  
   client.onreadystatechange=function(){
  
       if(client.readyState==4&amp;&amp;client.status==200)
       {
           alert(client.responseText); /* here i want to get the actual response i.e., my xml. I am also using fiddler to monitor. */
  
       }
   };
  
   dataString="projectid=1-105101";
   client.open("POST",url_action,true);
   client.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  
   client.send(dataString);
  }
  </code></pre>