title: how to get the response on same page rather than on new page
body: <p>In following code i am submitting form via submit but from javascript and the response is going to other page, is there any way to get that response on same page so that i can replace that content to somewhere using jquery.</p>
  
  <p>// controller side code</p>
  
  <pre><code> @RequestMapping(value = "upload", method=RequestMethod.POST) 
      public @ResponseBody String upload(HttpServletRequest request, HttpServletResponse response,
      @RequestPart("dataFile") MultipartFile file
      ){ if(file!=null){
      //code to upload file and will return 1
              return "1";
          }
          return "0";//otherwise it will return 0
      }
  </code></pre>
  
  <p>Following is html side code</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;script language="Javascript"&gt;
  function fileUpload(form) {  
      // Submit the form...
      form.submit();
  // here if i get that response then i'll be able to put that content somewhere else via jQuery. i dont want response directed on url/upload.
  
  }
  &lt;/script&gt;
  
  //html code 
  &lt;!-- index.php could be any script server-side for receive uploads. --&gt;
  &lt;form target="upload_iframe" method="post" action="upload" enctype="multipart/form-data" encoding="multipart/form-data"&gt;
  &lt;input type="file" name="dataFile" id="dataFile" /&gt;&lt;/br&gt;
  &lt;input type="button" value="upload"
          onClick="fileUpload(this.form); return false;" &gt;
  &lt;div id="uploadShow"&gt;&lt;/div&gt;
  &lt;/form&gt;
  
  &lt;/html&gt;
  </code></pre>