title: How to redirect ftl in spring boot?
body: <p>I have already created an e mail confirmation in spring boot it is working nicely, and also I created a link when a user click it should say "confirmed"but I did not figure it out how to do that? </p>
  
  <p>E mail sender java class:</p>
  
  <pre><code>@Component
  public class EmailSender {
  
      @Autowired 
      JavaMailSender javaEmailSender;
      public void sendEmail(String to, String subject, String text) throws MessagingException {
           MimeMessage message = javaEmailSender.createMimeMessage();
           MimeMessageHelper helper = new MimeMessageHelper(message,
                      MimeMessageHelper.MULTIPART_MODE_MIXED_RELATED,
                      StandardCharsets.UTF_8.name());
          helper.setTo(to);
          helper.setSubject(subject);
          helper.setText(text, true);
          helper.addInline("logo.jpg", new ClassPathResource("./images/logo.jpg"));
          javaEmailSender.send(message);
      }
  
  
  }
  </code></pre>
  
  <p>E mail template Loader:</p>
  
  <pre><code>@Component
  public class EmailTemplateLoader {
  
      @Autowired
      private Configuration freemakerConfiguration;
  
      public String getEmailBody(String name, String confirmationLink) throws TemplateException {
  
          try {
              Template template = freemakerConfiguration.getTemplate("EmailConfirmation.ftl");
  
              Map&lt;String, Object&gt; data = new HashMap&lt;String, Object&gt;();
              data.put("name", name);
              data.put("confirmationLink", confirmationLink);
  
              return FreeMarkerTemplateUtils.processTemplateIntoString(template, data);
  
          } catch (IOException e) {
              e.printStackTrace();
          } catch (TemplateException e) {
              e.printStackTrace();
          }
          return "";
      }
  }
  </code></pre>
  
  <p>My signup Resource :</p>
  
  <pre><code>@Autowired
      private SignupService signupService;
      @Autowired
      private HttpServletRequest httpServletRequest;
  
      @RequestMapping(value = "user/signup", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
      @Transactional(rollbackFor = Exception.class)
      public ResponseEntity&lt;?&gt; signup(@RequestBody UserType user) throws SignUpException {
          URL requestUrl = null;
          try {
              requestUrl = new URL(httpServletRequest.getRequestURL().toString());
          } catch (MalformedURLException e) {
              logger.debug("Malformed Request Url");
          }
          logger.debug(requestUrl.toString());
          signupService.signUp(user, requestUrl.getHost());
          return new ResponseEntity&lt;&gt;(HttpStatus.OK);
      }
  
      @RequestMapping(value = "user/confirmation", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
      @Transactional(rollbackFor = Exception.class)
      public ResponseEntity&lt;?&gt; confirmSignUp(@RequestParam("u") String loginName, @RequestParam("p") String token) {
          try {
              signupService.emailConfirmation(loginName, token);
              return new ResponseEntity&lt;&gt;(HttpStatus.OK);
          } catch (SignUpException e) {
              return new ResponseEntity&lt;&gt;(e.getMessage(), HttpStatus.BAD_REQUEST);
          }
      }
  </code></pre>
  
  <p>So, As I told I can send an email successfully, but I could not sort how I can write confirmation successfully </p>