O'Reilly logo

Liferay 6.2 User Interface Development by Jonas X. Yuan, Xinsheng Chen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Web content that accesses a database

A developer can call Liferay services in the content template to access the Liferay Portal database. Before they can call those Liferay services, they should first set the following properties in the portal-ext.properties file and restart the Liferay Portal instance as shown in the following code:

..journal.template.velocity.restricted.variables=

This setting makes it so that the developer is not restricted from using any variables in the Velocity or Freemarker contexts, including the Liferay service variables.

Reading from a database

Suppose a company's website has a page for the description of their Chief Executive Officer (CEO). The CEO's data is saved in the database. We will create a piece of web content to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required