title: How to make java response to my html selection list
body: <p>I am working a jsp file with java+html. I want my selection list being able to change a variable <strong>int k</strong> in a part of java codes to <code>out.println</code> the different data sets for google pie chart which I am already done. By now, I merely know how to create a simple select list.
  <strong>What other information or techniques should I gather?</strong>
  Thanks in advance. </p>
  
  <pre><code>&lt;select name="monthpick" id="monthpick"&gt;
      &lt;option value="0"&gt;Jan16&lt;/option&gt;
      &lt;option value="1"&gt;Feb16&lt;/option&gt;
      &lt;option value="2"&gt;Mar16&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I want the the list can pass the value to <strong>k</strong> so that I can select what data set I want.</p>
  
  <pre><code>&lt;%
  String columnName = pchart.getColumnHeader(k);
  String[][] pdata = pchart.getPieChartData(columnName, rowTitle);
  for (int i=0;i&lt;pdata.length;i++){
          out.println("[");
          for (int j=0;j&lt;pdata[i].length;j++){    
              //...many out.println()
  
          }
      }
  %&gt;
  </code></pre>
  
  <p>Just for reference , the loop will out.print sth like below for pie chart:</p>
  
  <pre><code>['AA', 31578049.4], 
  ['BB', 8668926.34], 
  ['CC', 181917208.64], 
  ['GG', 164748309.85], 
  ['NN', 0], 
  ['PA', 0], 
  </code></pre>