title: send java array from jsp to controller in spring using ajax
body: <p>I have a jsp page which have a double[] array in java and a button, this is the code for JSP :</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%&gt;
  &lt;%
  
      double[] beta = {1.2,4.3,1.0};       
  
  %&gt;
  
  &lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;button id="validate"&gt;Validate&lt;/button&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>On validate button click I am making a ajax call which is sending request to controller :</p>
  
  <pre><code>$('#validate').click(function() {
  $.ajax({
      url : 'controllerMethod'
      type : 'POST'
      data : ''
      success:function(data){
  
      }
  });
  });
  </code></pre>
  
  <p>How can I send beta array with ajax request so that i can access it in controller method.</p>
  
  <pre><code>@RequestMapping(value = "/controllerMethod", method = RequestMethod.POST)
  @ResponseBody
   public String validateSymbol(WebRequest webRequest,Model model,HttpServletRequest request, HttpServletResponse response) {
  
      //beta;
  
   }
  </code></pre>