Foros de discusión

parse string in velocity file

Abhishak Mishra, modificado hace 11 años.

parse string in velocity file

Junior Member Mensajes: 28 Fecha de incorporación: 29/02/12 Mensajes recientes
Hi,

I need to parse string in velocity file and use the parsed string for operation.. e.g.

"serviceLocator.findService("com.liferay.portal.service.LayoutLocalService")" is the string, which is written in any config file.

now i need to use
#set($layoutService = "$serviceLocator.findService("com.liferay.portal.service.LayoutLocalService")")

which should work like

#set($layoutService = $serviceLocator.findService("com.liferay.portal.service.LayoutLocalService"))


Is there any way, which we can achieve same.

Thanks in advance..
Abhishak
thumbnail
David H Nebinger, modificado hace 11 años.

RE: parse string in velocity file

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Not being a velocity pro, if you know you're going to be returning a layout service, you could build a small wrapper in an EXT plugin which is responsible for returning the service, handling the dynamic portion of the service definition...