0

My code is looks like this:

                    <li class="${properties.kcFormSocialAccountListLinkClass!}"><a href="http://localhost:4200/" id="zocial-${p.alias}" class="zocial ${p.providerId}"> <span>Sign in using OTP</span></a></li>
               

the problem is that, I need to send the current window url as query param with the localhost:4200/ . How do I do that ? the file is of FTL Type.

1 Answers1

0

This can be achieved by accessing Servlet Request object using:

${springMacroRequestContext.requestUri}

Which will return/print /help if the ftl was a page with URL http://www.example.com/help The object springMacroRequestContext is a representation of RequestContext class: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/support/RequestContext.html

However, I see you are not using Spring MVC or Spring Boot thus I'm afraid you can't use it, so why not just do it with Javascript:

var url = window.location.href;

Check this answer for more options.

Cortex
  • 585
  • 3
  • 19