@RequestMapping(value = "/forgetform", method = RequestMethod.POST)
 public ModelAndView forgetForm(
     HttpServletRequest request, @RequestParam("id") String hdnmerchantId) {
   System.out.println("In auth forgetForm method");
   String mailid = request.getParameter("email");
   System.out.println("mailid" + mailid);
   ModelAndView model = new ModelAndView();
   Merchant merchant = new Merchant();
   String randomPwd = generateRandomString();
   String encryptedPwd = encrypt(randomPwd);
   System.out.println("merchantId==>" + encryptedPwd);
   if (encryptedPwd != null) {
     merchant.setAutogeneratedPassword(encryptedPwd);
   } else {
     merchant.setAutogeneratedPassword("");
   }
   String password = merchant.getAutogeneratedPassword();
   System.out.println("password==>" + password);
   String decryptedPwd = decrypt(password);
   merchantService.updateautopassword(hdnmerchantId, decryptedPwd);
   List<Merchant> merchantList = merchantService.getMerchantdetails(hdnmerchantId);
   System.out.println("Modifylist" + merchantList);
   String mername = merchantList.get(0).getMerchantName();
   System.out.println("mername" + mername);
   sendEmailPassword(mailid, request, password, mername);
   String merchantId = merchantList.get(0).getMerchantId();
   System.out.println("mername" + mername);
   model.addObject("mername", mername);
   model.addObject("merchantId", hdnmerchantId);
   model.setViewName("acquirer/mailforget");
   return model;
 }