title: Keep the radio button selected after refreshing the page or submitting the request
body: <p>I understand this question may sound very basic but I have been trying to solve it  and I still haven't been able to do it. I will really appreciate any help.</p>
  
  <p>I have two radio buttons in my jsp page. When either one is selected, it calls a Javascript function. What eventually happens is if you select radio button 1, it displays data from table 1, if radio button 2 is selected, then data from table 2 is displayed. </p>
  
  <p>As a result, my page gets refreshed and the radio buttons are not selected anymore. I would like to show the user which radio button was selected. </p>
  
  <pre><code>function viewUploadedData(){
      document.location.href = "ForecastInquiryFilter.do?exportVar=viewUploadedData";
  
  function viewTopsData(radio){
      document.location.href = "ForecastInquiryFilter.do?exportVar=viewTopsData";
  }
  </code></pre>
  
  
  
  <pre><code>&lt;input type="radio" name="dataTypeToView" id="topsData" onclick="viewTopsData();"/&gt;
  &lt;label for="topsData"&gt;TOPS Data&lt;/label&gt;&lt;br/&gt;
  &lt;input type="radio" name="dataTypeToView" id="uploadedData" onclick="viewUploadedData();"/&gt;
  &lt;label for="uploadedData"&gt;Uploaded Data &lt;/label&gt;
  </code></pre>