Thứ Tư, 15 tháng 5, 2013
How to turn on serviceLocator?
Today, when I create a velocity template to generate menu to some static articles, I have to use ServiceLocator to get JournalArticleLocalService, but it seem nothing happens. After searching for longtime, I see that there is no error in code, but it doesn't work. Then I know that I didn't turn on variable serviceLocator for Velocity.
To turn it on, please insert "journal.template.velocity.restricted.variables=" in file portal-ext.properties in liferay\tomcat-7.0.27\webapps\ROOT\WEB-INF\classes.
Hope that this is solve your problem
$serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService")
Đăng ký:
Bài đăng (Atom)