title: How to pass parameters to servlet using Ext.Ajax.request?
body: <p>I have an extjs form from which I am trying to post parameter using Ext.Ajax.request to the servlet. Call is working and servlet is being called but for some reason parameter's value isn't being send. I'll post my code, can anyone tell me what I am doing wrong. Thanks in advance.</p>
  
  <p>This is the call from ExtJS form:</p>
  
  <pre><code>buttons: [{
  
          text: 'Search',
          handler: function(){
  
                            var fName = Ext.getCmp("fName").getValue();
  
                            Ext.Ajax.request({
  
                                 url : 'LookUPCustomer',
  
                                 method: 'POST',
                                 headers: { 'Content-Type': 'application/json'},                    
                                 params : fName, // this value isn't being passed to servlet
  
  
                                 success: function ( result, request ) {
                                      var resultData1 = JSON.parse(result.responseText);
                                 },
  
                                 failure: function ( result, request ) {
                                   resultData = JSON.parse(xmlhttp.responseText);
                                 }        
  
                            });
  
                 }]; 
  </code></pre>
  
  <p>and here is servlet code:</p>
  
  <pre><code>   protected void doPost(HttpServletRequest request, HttpServletResponse response)
                  throws ServletException, IOException {
  
  
           PrintWriter out = response.getWriter();
  
           // value of fName is null, not being passed from the form
           String fName = request.getParameter("fName");
  
           // does some processing....
  
  
      // print back to the form
           response.setContentType("application/json");
  
       out.println(jsArray);      
     }
  </code></pre>