O'Reilly logo

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

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

Velocity portlet

We now write a Java Portlet Specification 2.0 (JSR 286) compliant Velocity portlet in Liferay Plugins SDK.

  1. Run create.bat velocity Velocity in ${PLUGINS_SDK_HOME}/portlets/. This will create a velocity-portlet/ folder
  2. In the ${PLUGINS_SDK_HOME}/portlets/velocity-portlet/docroot/WEB-INF/src/ folder, create a com.sample.jsp.portlet.VelocityPortlet.java file. Its main content is as follows:
    public void doView( … ) throws PortletException { // ignore details Template template = getTemplate(_viewTemplate); mergeTemplate(template, renderRequest, renderResponse); // ignore details } // ignore details protected Template getTemplate(String name) throws Exception { Properties p = new Properties(); p.setProperty( "resource.loader", "class" ...

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