title: Make table row clickable and pass a post parameter to jquery function
body: <p>I have created a table and filled it with elements taken through  JSTL tag and EL expression like this</p>
  
  <pre><code>&lt;c:forEach items="${routes_list}" var="route"&gt;
      &lt;tr&gt;
         &lt;td&gt;${route.airlane}&lt;/td&gt;
         &lt;td&gt;${route.aircraft_id}&lt;/td&gt;
         &lt;td&gt;${route.airport_city_source.city}&lt;/td&gt;
         &lt;td&gt;${route.airport_city_dest.city}&lt;/td&gt;
         &lt;td&gt;&lt;fmt:formatDate value="${route.departure_date}" pattern="dd/MM/yyyy hh:mm"/&gt;&lt;/td&gt;
         &lt;td&gt;&lt;fmt:formatDate value="${route.arrival_date}" pattern="dd/MM/yyyy hh:mm"/&gt;&lt;/td&gt;
         &lt;td&gt;${route.travel_class}&lt;/td&gt;
       &lt;/tr&gt;
   &lt;/c:forEach&gt;
  </code></pre>
  
  <p>what I would like to do is to make every row clickable. I have achieved this  by using this function</p>
  
  <pre><code>$("tr").click(function() {
  window.location.href = $(this).find("a").attr("href");
  });
  </code></pre>
  
  <p>but my real goal is to pass to href <code>${route.id}</code> in order to send a post request to a servlet and make some task. I'm not a jquery programmer so I don't know how to proceed. Thank you folks</p>
  
  <p>EDIT</p>
  
  <pre><code>$(".show_reservations").click(function() { //show.reservations css class
  var href  = $(this).find("a").attr("href");
  $.ajax({
      cache:false,
      dataType:"html",
      data:"${route.id}="+href,
      type: "POST",
      url: "admin_show_reservations", //NAME OF THE SERVLET
      success: function(data)
               {
                  //console.log(data);
                  alert("success"+data);
               },
      error: function(exception)
      {
      alert("error");
      }
      });
  });
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;section class="area_principal"&gt;
      &lt;h4&gt;Voli&lt;/h4&gt;
      &lt;div class="body_area_principal"&gt;
          &lt;c:choose&gt;
              &lt;c:when test="${!empty routes_list}"&gt;
                  &lt;table class="show_reservations"&gt;
                      &lt;tr&gt;
                          &lt;th&gt;Compagnia&lt;/th&gt;
                          &lt;th&gt;ID Veivolo&lt;/th&gt;
                          &lt;th&gt;Partenza&lt;/th&gt;
                          &lt;th&gt;Arrivo&lt;/th&gt;
                          &lt;th&gt;Ora partenza (ora locale)&lt;/th&gt;
                          &lt;th&gt;Ora arrivo (ora locale)&lt;/th&gt;
                          &lt;th&gt;Classe&lt;/th&gt;
                      &lt;/tr&gt;
                      &lt;c:forEach items="${routes_list}" var="route"&gt;
                          &lt;tr&gt;
                              &lt;td&gt;${route.airlane}&lt;/td&gt;
                              &lt;td&gt;${route.aircraft_id}&lt;/td&gt;
                              &lt;td&gt;${route.airport_city_source.city}&lt;/td&gt;
                              &lt;td&gt;${route.airport_city_dest.city}&lt;/td&gt;
                              &lt;td&gt;&lt;fmt:formatDate value="${route.departure_date}" pattern="dd/MM/yyyy hh:mm"/&gt;&lt;/td&gt;
                              &lt;td&gt;&lt;fmt:formatDate value="${route.arrival_date}" pattern="dd/MM/yyyy hh:mm"/&gt;&lt;/td&gt;
                              &lt;td&gt;${route.travel_class}&lt;/td&gt;
                          &lt;/tr&gt;
                      &lt;/c:forEach&gt;
                  &lt;/table&gt;
              &lt;/c:when&gt;
              &lt;c:otherwise&gt;
                  &lt;p&gt;Non ci sono voli nel sistema. Aggiungerli attraverso la voce presente nel menù sulla sinistra&lt;/p&gt;
              &lt;/c:otherwise&gt;
          &lt;/c:choose&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>GENERATED HTML</p>
  
  <pre><code>&lt;section class="area_principal"&gt;
      &lt;h4&gt;Voli&lt;/h4&gt;
      &lt;div class="body_area_principal"&gt;
  
  
                  &lt;table class="show_reservations"&gt;
                      &lt;tr&gt;
                          &lt;th&gt;Compagnia&lt;/th&gt;
                          &lt;th&gt;ID Veivolo&lt;/th&gt;
                          &lt;th&gt;Partenza&lt;/th&gt;
                          &lt;th&gt;Arrivo&lt;/th&gt;
                          &lt;th&gt;Ora partenza (ora locale)&lt;/th&gt;
                          &lt;th&gt;Ora arrivo (ora locale)&lt;/th&gt;
                          &lt;th&gt;Classe&lt;/th&gt;
                      &lt;/tr&gt;
  
                          &lt;tr&gt;
                              &lt;td&gt;Alitalia&lt;/td&gt;
                              &lt;td&gt;AZ198EG&lt;/td&gt;
                              &lt;td&gt;Catania&lt;/td&gt;
                              &lt;td&gt;Milan&lt;/td&gt;
                              &lt;td&gt;18/06/2014 07:00&lt;/td&gt;
                              &lt;td&gt;18/06/2014 08:35&lt;/td&gt;
                              &lt;td&gt;Economy&lt;/td&gt;
                          &lt;/tr&gt;
  
                          &lt;tr&gt;
                              &lt;td&gt;Emirates&lt;/td&gt;
                              &lt;td&gt;EA343E3&lt;/td&gt;
                              &lt;td&gt;Catania&lt;/td&gt;
                              &lt;td&gt;Dubai&lt;/td&gt;
                              &lt;td&gt;18/06/2014 09:00&lt;/td&gt;
                              &lt;td&gt;19/06/2014 05:00&lt;/td&gt;
                              &lt;td&gt;Economy&lt;/td&gt;
                          &lt;/tr&gt;
  
                  &lt;/table&gt;
  
  
  
      &lt;/div&gt;
  &lt;/section&gt;
  </code></pre>