request.getParameter is undefined in Application Display Termplate?

1.3k Views Asked by At

I am using Liferay 6.2 and I am trying to read request parameters in my Application Display Template (freemarker) like this:

<#assign myvalue = request.getParameter("param")/>

But all I get is:

Error on line 5, column 1 in 10154#10194#11902
request.getParameter("param") is undefined.
It cannot be assigned to myvalue.

Does anyone know how to solve this ? The built-in editor itself and its code completion told me everything is fine ;)

1

There are 1 best solutions below

0
On BEST ANSWER

Pankaj Kathiriya was right :)

The answer is :

<#if (request.getParameter("param")?has_content && request.getParameter("param")?lower_case?matches("true"))> <#assign useServer = "http://bing.com"> <#else> <#assign useServer = "http://google.com">