title: How to pass date id from one jsp to another jsp page
body: <p>I am calculating the price of a ticket with discount on weekdays and weekends based on the time duration.So, i gave inputs of duration and  date using datepicker plugin which is in Above Page. For this i am getting proper result.But i have to create two different jsp pages(date.jsp and cal.jsp).
   In 1st jsp page(date.jsp) i am selecting date using datepicker. And in 2nd jsp page(cal.jsp) </p>
  
  <p>I have written a <code>method -&gt;[caluculate(#dateid,#duratiionid)]</code> to calulate the price by taking inputs as time duration.</p>
  
  <p>Here My Question is how shall i pass <code>[#dateid]</code> from 1st jsp page(date.jsp) to 2nd jsp page(cal.jsp) 
  so that i can pass both the id's in this <code>method-&gt;[caluculate(#dateid,#duratiionid)]</code>.</p>
  
  <pre><code>&lt;div id="container"&gt;
      &lt;div id="form"&gt;
          &lt;form id="book_court"&gt;
              &lt;div class="fieldset"&gt;
              &lt;fieldset&gt;
                  &lt;legend class="visuallyhidden"&gt;Booking Details&lt;/legend&gt;
                  &lt;h2&gt;Booking Details&lt;/h2&gt;                 
                  &lt;p&gt;
                      &lt;label for="date"&gt;Date&lt;br/&gt;&lt;span id="dateNote"&gt;Firefox does not have a HTML5 datepicker &lt;a href="https://support.mozilla.org/en-US/questions/986096"&gt;yet&lt;/a&gt;.&lt;/span&gt;&lt;/label&gt;
                      &lt;input type="date" name="date" id="date" min="today" required /&gt;
                  &lt;/p&gt;
                  &lt;p&gt;
                      &lt;label for="tickets_duration"&gt; Hours&lt;/label&gt;
                      &lt;input type="number" min="1" name="tickets_duration" id="tickets_duration" required /&gt;
                  &lt;/p&gt;
  
                  &lt;p&gt;
                      &lt;label&gt;Total Price&lt;/label&gt;
                      &lt;span id="total_price"&gt;(enter data first)&lt;/span&gt;
                  &lt;/p&gt;
                  &lt;div id="submit_wrapper"&gt;
                      &lt;input type="submit" id="submit" value="Book Court" /&gt;
                  &lt;/div&gt;
              &lt;/fieldset&gt;
              &lt;/div&gt;
          &lt;/form&gt;
          &lt;/div&gt;
          &lt;/div&gt;
  &lt;script id="worker" type="javascript/worker"&gt;
      self.onmessage = function msgWorkerHandler(event){
          var jsonString = event.data;
  
          var day = jsonString.day;
          var tickets_duration = jsonString.tickets_duration;
  
          // set price of each hours as Rs. 200 and 300
          var totalPriceOnWeekday = tickets_duration * 200;
          var totalPriceOnWeekends=tickets_duration * 300;
  
          // 10% discount if on weekday and 15% on weekends
          if(day &gt; 0 &amp;&amp; day &lt; 6){
              totalPriceOnWeekday = totalPriceOnWeekday - 0.10 * totalPriceOnWeekday;
             postMessage("&amp;#x20b9; " + totalPriceOnWeekday);
          }else if(day == 0 || day == 7){
              totalPriceOnWeekends = totalPriceOnWeekends - 0.15 * totalPriceOnWeekday;
  
          postMessage("&amp;#x20b9; " + totalPriceOnWeekends);
        }
      }
  &lt;/script&gt;
  
  &lt;script&gt;
  $(document).ready(function(){
  
      // first check the movies already book
  
      // apply jQuery UI Redmond theme to 'Book Tickets' button
      $("#submit").button();
  
      // calculateTotalPrice on keyup or on change of movie/date/tickets
      $("#date, #tickets_duration").change(calculateTotalPrice);
  
      // on form submit
      $("#book_court").submit(function(event){
  
          // prevent on submit page refresh
          event.preventDefault();
  
          // check locally stored data     
          // clear the form                   
          $( '#book_court' ).each(function(){
              this.reset();
          });
  
          // reset (enter data first) message
          $("#total_price").html("(enter data first)");
  
          // update movies booked list
      });
  
      // set minimum date in datepicker as today
      var today = new Date().toISOString().split('T')[0];
      document.getElementsByName("date")[0].setAttribute('min', today);
  
  });
  
  function calculateTotalPrice(){
      if($("#tickets_duration").val() != "" &amp;&amp; $("#date").val() != ""){
          if(window.Worker){
              // create web worker
              var blob = new Blob(
                  [document.querySelector("#worker").textContent],
                  {type: 'text/javascript'});
              var worker = new Worker(window.URL.createObjectURL(blob));
  
              worker.onmessage = function(event){
                  $("#total_price").html(event.data);
              }
              worker.onerror = function(errorObject){
                  $("#total_price").html("Error: " + errorObject.message);
              }               
                var date = new Date($('#date').val());
  
              // get day
              var day = date.getDay();
  
              // get number of booked shows
  
              // send JSON data to worker                     
              var jsonData = {'day': day, 'tickets_duration': Number($("#tickets_duration").val())};
              worker.postMessage(jsonData);
          }
      }
  }
  &lt;/script&gt;
  </code></pre>