anchor.diff:      }
   
       function updateBeanAndPostTo(postURL, data) {
  +
  +        encodeSPCertificate();
  +
           $.ajax({
               type: "POST",
               url: 'update-application-bean.jsp?spName=<%=Encode.forUriComponent(spName)%>',
  
positive.code:         document.getElementById('sp-certificate').value = btoa(spCertificate);
      }
  
      function updateBeanAndRedirect(redirectURL) {
          var numberOfClaimMappings = document.getElementById("claimMappingAddTable").rows.length;
          document.getElementById('number_of_claim_mappings').value = numberOfClaimMappings;
  
negative.code: 
          var numberOfRoleMappings = document.getElementById("roleMappingAddTable").rows.length;
          document.getElementById('number_of_rolemappings').value = numberOfRoleMappings;
          encodeSPCertificate();
  
          $.ajax({
              type: "POST",
  