anchor.diff:                  URL url = null;
                   HttpURLConnection httpURLConnection = null;
   
  -                url = new URL(identityMgtEndpointContext + "/recoverpassword.do");
  +                url = new URL(identityMgtEndpointContext + "/recoverpassword.do?callback="+Encode.forHtmlAttribute
  +                        (urlEncodedURL ));
                   httpURLConnection = (HttpURLConnection) url.openConnection();
                   httpURLConnection.setRequestMethod("HEAD");
                   httpURLConnection.connect();
  
positive.code:     <%
          }
  
          url = new URL(identityMgtEndpointContext + "/recoverusername.do");
          httpURLConnection = (HttpURLConnection) url.openConnection();
          httpURLConnection.setRequestMethod("HEAD");
          httpURLConnection.connect();
  
negative.code:     </div>
      <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 form-group">
          <%
  
              String scheme = request.getScheme();
              String serverName = request.getServerName();
              int serverPort = request.getServerPort();
              String uri = (String) request.getAttribute("javax.servlet.forward.request_uri");
              String prmstr = (String) request.getAttribute("javax.servlet.forward.query_string");
              String urlWithoutEncoding = scheme + "://" +serverName + ":" + serverPort + uri + "?" + prmstr;
              String urlEncodedURL = URLEncoder.encode(urlWithoutEncoding, "UTF-8");
  
              if (request.getParameter("relyingParty").equals("wso2.my.dashboard")) {
                  String identityMgtEndpointContext =
                          application.getInitParameter("IdentityManagementEndpointContextURL");
  