get queryString of a URL on FreeMarker
I figured out to use request.getParameter("param")
<#if (request.getParameter("param")?has_content && request.getParameter("param")?lower_case?matches("true"))>
<#assign useServer = "http://bing.com">
<#else>
<#assign useServer = "http://google.com">
Worked like a charm.
For query string ?param1=abc¶m2=123
, you can retrive params like below:
${RequestParameters.param1
} & ${RequestParameters.param2}
And also try <#if RequestParameters.bing??>
parameters are something that followed by < protocol >://< host >:< port >?< param1 >&< param2 >&..
for example in https://www.google.co.in/search?q=StackOverflow URL param name is q and value is 'StackOverflow'