title: How to keep radio button selected after refresh the jsp page click in radio button
body: <p>I have two radio button, i want to refresh a page after click in the radio button how could i do this, i thought too much but not able to do it, i need your help.</p>
  
  <pre><code>&lt;script&gt;
   $(document).ready(function() {
          $(document).on('click', 'input[type=radio][name=test1]', function() 
              { 
              var clicked = localStorage['clicked'];
             $('.' + related_class).prop('disabled', false); 
            $('input[type=radio][name=test1]').not(':checked').each(function()
               { var other_class = $(this).val(); 
            $('.' + other_class).prop('disabled', true); 
          }); 
        });
     });    
   &lt;/script&gt;
  </code></pre>
  
  <p>Here is the first radio button for employee </p>
  
  <pre><code>&lt;td&gt;
      &lt;label for="radio1"&gt;
          &lt;input type="radio" name="test1" value="radio1" /&gt;&lt;b&gt;Employee&lt;/b&gt;
      &lt;/label&gt;    
      Select Employee 
          &lt;input type="image" img  src="resources/image/search.png"name="for_radio1[]" class="radio1"  disabled="true" onclick="openWindow()"/&gt; 
  &lt;/td&gt;
  </code></pre>
  
  <p>And here is the another radio button for role.  </p>
  
  <pre><code>&lt;td&gt;
      &lt;form action="/Submitrole" method="post" model="command"&gt;
          &lt;label for="radio2"&gt;&lt;input type="radio" name="test1" value="radio2"/&gt;Role &lt;/label&gt;&lt;br&gt;
                          Select Role :&lt;select  name="roleName"  class="radio2" disabled="true" style="width: 80px;"&gt;
                                          &lt;c:forEach items="${listRole}" var="role"&gt;
                                              &lt;option value="${role.roleName}"&gt;
                                                      &lt;c:out value="${role.roleName}" /&gt;
                                              &lt;/option&gt;
                                          &lt;/c:forEach&gt;
                                      &lt;/select&gt;
          &lt;input type="submit" value ="Check"&gt;
      &lt;/form&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>Controller.</p>
  
  <pre><code> @RequestMapping(value = "/compplan", method = RequestMethod.GET)
  public ModelAndView listRules(ModelMap model, HttpServletRequest request,HttpSession session, SessionStatus status) {
  
      roleApi.listOfRoles();
      ruleApi.listOfRules();
  
      model.addAttribute("listRole", roleApi.listOfRoles());
      model.addAttribute("listRules", ruleApi.listOfRules());
      RoleUI object = (RoleUI) request.getSession().getAttribute("roleName");
      if (object != null ) {
          RuleAssignment rAssdtail = ruleAssApi.searchAssignedRule(object.getRoleName());
          List&lt;RuleAssignmentDetails&gt; ptr1 = rAssdtail.getRuleAssignmentDetails();
          ArrayList&lt;Rule&gt; rl1 = new ArrayList&lt;Rule&gt;();
          List&lt;RuleParameter&gt; parameterList = new ArrayList&lt;RuleParameter&gt;();
          Iterator&lt;RuleAssignmentDetails&gt; it1 = ptr1.iterator();
          while (it1.hasNext()) {
              RuleAssignmentDetails rp = (RuleAssignmentDetails) it1.next();
              Rule r1 = rp.getRule();
              List&lt;RuleParameter&gt; ptr2 = r1.getRuleParameter();
              Iterator it = ptr2.iterator();
              while (it.hasNext()) {
                  RuleParameter r2 = (RuleParameter) it.next();
                  parameterList.add(r2);
              }
              rl1.add(r1);
          }       
          model.addAttribute("List2", rl1);
          status.setComplete();
          session.removeAttribute("roleName");
         return new ModelAndView("CompPlan"); 
      }
  
      EmployeeUI object1 = (EmployeeUI) request.getSession().getAttribute("EmployeeName");
      if(object1 != null) {
  
          RuleAssignment rAssdtail = ruleAssApi.searchAssignedRule(object1.getEmployeeName());
          List&lt;RuleAssignmentDetails&gt; ptr1 = rAssdtail.getRuleAssignmentDetails();
          ArrayList&lt;RuleAssignmentDetails&gt; ruleList1 = new ArrayList&lt;RuleAssignmentDetails&gt;();
          ArrayList&lt;Rule&gt; rl1 = new ArrayList&lt;Rule&gt;();
          List&lt;RuleParameter&gt; parameterList = new ArrayList&lt;RuleParameter&gt;();
          Iterator&lt;RuleAssignmentDetails&gt; it1 = ptr1.iterator();
          while (it1.hasNext()) {
  
              RuleAssignmentDetails rp = (RuleAssignmentDetails) it1.next();
              Rule r1 = rp.getRule();
              List&lt;RuleParameter&gt; ptr2 = r1.getRuleParameter();
  
              Iterator it = ptr2.iterator();
              while (it.hasNext()) {
                  RuleParameter r = (RuleParameter) it.next();        
                  parameterList.add(r);
              }
              rl1.add(r1);
          }
          model.addAttribute("List2", rl1);
          status.setComplete();
          session.removeAttribute("EmployeeName");
          request.getParameter("test1");
          return new ModelAndView("CompPlan");    
      }   
  return new ModelAndView("CompPlan");
  
  }
  </code></pre>
  
  <p>How could i do this, Please help me.</p>
  
  <p>Thank you.      </p>